我有带有单选按钮列表和 HTML 编辑器的页面。使用 HTML 编辑器控件,即使我使用的是 udpatepanel,每次选择单选按钮选项时页面都会刷新。如何防止页面刷新?
代码运行良好。问题出在 HTML 编辑器上。每次我更改单选按钮选项时,加载 HTML 编辑器控件都需要时间(页面闪烁)。
测试页
<asp:ScriptManager ID="SM22" runat="server" />
<asp:UpdatePanel ID="UpdatePanel22" runat="server">
<ContentTemplate>
<table style="width:100%;">
<tr>
<td style="width:30%;">
<asp:RadioButtonList ID="rblJobType" runat="server"
AutoPostBack="true" onselectedindexchanged="rblJobType_SelectedIndexChanged">
<asp:ListItem Value="O" Text="One Time"></asp:ListItem>
<asp:ListItem Value="D" Text="Daily" Selected="True"></asp:ListItem>
<asp:ListItem Value="W" Text="Weekly"></asp:ListItem>
<asp:ListItem Value="M" Text="Monthly"></asp:ListItem>
<asp:ListItem Value="Y" Text="Yearly"></asp:ListItem>
</asp:RadioButtonList>
</td>
</tr>
<tr id="test1" runat="server" visible="false">
<td><asp:TextBox ID="txtOneTimeDt" runat="server" Text="Once"></asp:TextBox></td>
</tr>
<tr id="test2" runat="server" visible="false">
<td><asp:TextBox ID="TextBox1" runat="server" Text="Daily"></asp:TextBox></td>
</tr>
<tr id="test3" runat="server" visible="false">
<td><asp:TextBox ID="TextBox2" runat="server" Text="Weekly"></asp:TextBox></td>
</tr>
<tr id="test4" runat="server" visible="false">
<td><asp:TextBox ID="TextBox3" runat="server" Text="Monthly"></asp:TextBox></td>
</tr>
<tr id="test5" runat="server" visible="false">
<td><asp:TextBox ID="TextBox4" runat="server" Text="Yearly"></asp:TextBox></td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
<br />
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<ajaxToolkit:Editor ID="heeEmail" Width="650px" Height="400px" runat="server"/>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</form>
最佳答案
关闭控件的自动发布属性,然后添加保存/提交按钮。
关于html - 每次使用 HTML 编辑器控件选择单选按钮时都会刷新页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23399273/