Reputation: 21
I have page with radio button list and HTML editor. With HTML editor control the page is refreshing every time I select radio button option even though I am using udpatepanel. How do I prevent the page refreshing?
Code is working fine. The issue is with HTML editor. every time I change the radio button option it is taking time (page blinking) to load the HTML editor control.
test page
<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>
Upvotes: 2
Views: 1868
Reputation: 1796
I found your code working properly when in rblJobType_SelectedIndexChanged I updated the text in textbox or show/hide the rows.
I suppose this is something related to updating any other control on your page which is outside udpate panel
Upvotes: 1
Reputation: 2522
Set the autopost property off for the control and then rather add a save / submit button.
Upvotes: 1