I have update panel in which I have radio buttons, labels and buttons. When I click button it is causing partial postback but when I click radio button list it is causing full postback what might be the issue ? Pelase help. This application is migrated from
.NET 1.1 to .NET4.0 I have even changed the xhtmlConformance mode="Legacy"/> to xhtmlConformance mode="Strict"/>"
Even with button partial post back is coming if I use Asynchronous Postback otherwise it doesn't work.
When any elemnt with AutoPostBack="True" property is set , when an event is performed a PostBack occurs and the whole page gets refreshed.. In your case because the RadioButttonList is not set as a trigger to the Update Panel it causes a Post back .. To
avoid this you need to set the
According to following post there's an issue with list controls like RadioButtonList or CheckBoxList used as trigger for an UpdatePanel. The full postback happens because the trigger registers the list container as an asynchronous control but the postback
is fired by a child control with a different id. I've added this issue to the unofficial bug/issue list.
You need do registerAsyncPostBackControl each time in page load phase. Or you can try the client-side appraoch.
Define html checkbox input control. In onchange event, you can call $get('id'') .style.display="none"/"block"; to show or hide the panel and update the updatepanel via the client-side approach.
sbmdude
Member
177 Points
153 Posts
Radiobutton list causing Full POstback in Update Panel
Jan 18, 2012 03:33 PM|LINK
I have update panel in which I have radio buttons, labels and buttons. When I click button it is causing partial postback but when I click radio button list it is causing full postback what might be the issue ? Pelase help. This application is migrated from .NET 1.1 to .NET4.0 I have even changed the xhtmlConformance mode="Legacy"/> to xhtmlConformance mode="Strict"/>"
Even with button partial post back is coming if I use Asynchronous Postback otherwise it doesn't work.
</div>sushanth009
Contributor
6243 Points
1168 Posts
Re: Radiobutton list causing Full POstback in Update Panel
Jan 18, 2012 04:22 PM|LINK
When any elemnt with AutoPostBack="True" property is set , when an event is performed a PostBack occurs and the whole page gets refreshed.. In your case because the RadioButttonList is not set as a trigger to the Update Panel it causes a Post back .. To avoid this you need to set the
<asp:UpdatePanel ID="UP1" runat="server" UpdateMode="Conditional"> <Triggers> <asp:AsyncPostBacktrigger ControlID = "RadioButtonList1" /> <asp:AsyncPostBacktrigger ControlID = "Button1" /> </Triggers> <ContentTemplate> <asp:RadioButtonList id="RadioButtonList1" AutoPostBack="True runat="server"> </asp:RadioButtonList > <asp:Button id="Button1" runat="server"> </asp:Button > </ContentTemplate> </asp:UpdatePanel>Try something like this and see if this helps..
sbmdude
Member
177 Points
153 Posts
Re: Radiobutton list causing Full POstback in Update Panel
Jan 18, 2012 05:15 PM|LINK
I already did that
<asp:AsyncPostBackTrigger ControlID="rbtnMain" EventName="SelectedIndexChanged" />
no luck.. any ideas
chetan.sarod...
All-Star
65839 Points
11163 Posts
Re: Radiobutton list causing Full POstback in Update Panel
Jan 19, 2012 02:09 AM|LINK
Refer this thread
http://blogs.msdn.com/b/mikeormond/archive/2007/03/26/the-curious-case-of-the-radiobuttonlist-not-triggering.aspx
According to following post there's an issue with list controls like RadioButtonList or CheckBoxList used as trigger for an UpdatePanel. The full postback happens because the trigger registers the list container as an asynchronous control but the postback is fired by a child control with a different id. I've added this issue to the unofficial bug/issue list.
http://forums.asp.net/t/1015714.aspx
You need do registerAsyncPostBackControl each time in page load phase. Or you can try the client-side appraoch.
Define html checkbox input control. In onchange event, you can call $get('id'') .style.display="none"/"block"; to show or hide the panel and update the updatepanel via the client-side approach.
http://vincexu.blogspot.com/2008/10/when-you-do-postback-via-control-which.html
Senior Software Engineer,
Approva Systems Pvt Ltd, Pune, India.