我将以下控件放在更新面板中,以便整个页面不会刷新。单击按钮时,页面不会刷新,但是当我尝试更改单选按钮时,页面会刷新并导致完整的回发。这是我的代码:
<ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager" runat="Server" EnablePartialRendering="true" />
<asp:UpdatePanel ID="updatePanelToggle" runat="server">
<ContentTemplate>
<asp:RadioButton ID="radioOn" AutoPostBack="true" runat="server" GroupName="toggle" Text="On" OnCheckedChanged="radioOn_CheckedChanged" />
<asp:RadioButton ID="radioOff" AutoPostBack="true" runat="server" GroupName="toggle" Text="Off" OnCheckedChanged="radioOff_CheckedChanged" />
<asp:Button ID="testButton" runat="server" OnClick="mybutton_click"/>
</ContentTemplate>
</asp:UpdatePanel>