DataList中链接跳转页面传参数:
前台:
<asp:DataList ID="dlRep" runat="server" OnItemCommand="dlRep_ItemCommand" Width="900px">
<HeaderTemplate>
<table border="1px" style=" 950px;">
<tr>
<td>
<asp:LinkButton ID="lnkbtnAdd" runat="server" Text="新增维修记录(传机房编号及设备编号)" CommandName='<%#Eval("JF_ID")+","+Eval("DEVICE_ID")%>'
Width="48px"></asp:LinkButton>
</td>
</tr>
</table>
</HeaderTemplate>
</asp:DataList>
后台:
//DataList中链接跳转页面 传参数
protected void dlRep_ItemCommand(object Sender, DataListCommandEventArgs e)
{
string str = e.CommandName;
Response.Redirect("DevicesRepair_Maintain.aspx?TYPE='ADD'&ID=" + str);
}