html代码
<asp:GridView ID="gridprodlist" runat="server" AutoGenerateColumns="False" EmptyDataText="No record" Width="100%">
<Columns>
<asp:TemplateField HeaderText="Edit<br/>Delete<br/>Disable">
<ItemTemplate>
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td valign="top">
<asp:UpdatePanel ID="UpdatePanel100" runat="server">
<ContentTemplate>
<asp:CheckBox ID="chkdis" runat="server" AutoPostBack="True" OnCheckedChanged="chkdis_CheckedChanged" ValidationGroup='<%# Eval("pid") %>' Text="Disable" />
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
</table>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
.cs 代码
protected void chkdis_CheckedChanged(object sender, EventArgs e)
{
CheckBox chkdis = (CheckBox)sender;
int id = Convert.ToInt32(((CheckBox)sender).ValidationGroup);
if (chkdis.Checked == true)
{
}
else
{
}
}
我已将 updatepanel 放在 gridview 中,但仍然单击我的复选框,我的页面会刷新。我应该怎么办?我不希望我的页面刷新