gridview的选中行事件
前台<asp:GridViewrunat="server"AutoGenerateColumns="False"ID="GridView1"AllowPaging="Tr...
前台
<asp:GridView runat="server" AutoGenerateColumns="False" ID="GridView1" AllowPaging="True"
Width="100%" AutoCreateNumber="False" ShowHeader="False" CssClass="GridTable"
EnterpriseNameCellNumber="-1" RecordCount="0" DataSourceID="SqlDataSource1"
Height="100%" onselectedindexchanged="GridView1_SelectedIndexChanged" >
<Columns>
<%-- <asp:BoundField DataField="Q_name" HeaderText="Q_name" SortExpression="Q_name" />--%>
<asp:TemplateField>
<ItemTemplate>
<table>
<tr>
<td colspan="2">
<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/Content.aspx"> <%# Eval("Q_name")%>
</asp:HyperLink>
</td>
</tr>
</table>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
后台
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
{
string sss = " asdadassaadsd";
Session["name"] = sss;
Response.Write("<script language='javascript'>alert('调试用!');</script>");
}
点击griciiew的行进入下一个页面不传递session;感觉并没有执行GridView1_SelectedIndexChanged这一个事件
急急急急! 展开
<asp:GridView runat="server" AutoGenerateColumns="False" ID="GridView1" AllowPaging="True"
Width="100%" AutoCreateNumber="False" ShowHeader="False" CssClass="GridTable"
EnterpriseNameCellNumber="-1" RecordCount="0" DataSourceID="SqlDataSource1"
Height="100%" onselectedindexchanged="GridView1_SelectedIndexChanged" >
<Columns>
<%-- <asp:BoundField DataField="Q_name" HeaderText="Q_name" SortExpression="Q_name" />--%>
<asp:TemplateField>
<ItemTemplate>
<table>
<tr>
<td colspan="2">
<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/Content.aspx"> <%# Eval("Q_name")%>
</asp:HyperLink>
</td>
</tr>
</table>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
后台
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
{
string sss = " asdadassaadsd";
Session["name"] = sss;
Response.Write("<script language='javascript'>alert('调试用!');</script>");
}
点击griciiew的行进入下一个页面不传递session;感觉并没有执行GridView1_SelectedIndexChanged这一个事件
急急急急! 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询