Gridview SelectedIndexChanged持续刷新页面?

时间:2013-04-12 02:23:31

标签: asp.net gridview

我有一个gridview,当我选择一行时,会出现Gridview_SelectedIndexChanged中的代码。但是,我注意到当我刷新时,调试器仍然进入这个方法?因此,当我刷新或返回页面时,就像用户点击了他离开的行一样。这是我的.aspx gridview代码:

  <asp:GridView ID="gridview1" CellPadding="8" runat="server" AllowPaging="True"
    AutoGenerateColumns="False" DataSourceID="testdb" onclick="RowCommand" 
    onselectedindexchanged="MsgInbox_SelectedIndexChanged" PageSize="25" 
    AllowSorting="True" OnRowCreated="Gridview_RowCreated" 
    OnRowDataBound =   "MsgInbox_RowDataBound" DataKeyNames = "primaryKey" 

0 个答案:

没有答案