Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Nov 10, 2011 02:02 PM by MoneyRan
Nov 04, 2011 09:05 PM|LINK
I have a very big form with lots of questions for the user to answer. Almost all of the controls are AutoPostBack as some other controls are enabled/disabled depending on thier answers. But if suppose I click on a radiobutton with AutoPostBack On, the page
reloads as it should, but takes me to the top and then I have scroll back down to answer the next question. How to avoid that? It's a long form and I want theleast inconvenience to the user....
I just know that AJAX can help me control this, but I don't know where to start... Can anyone suggest something?
Nov 05, 2011 04:44 AM|LINK
The most easiest solution is use UpdatePanel put your all controls that cause post back in that , it will no longer post backs
To use update panel first drag Scriptmanager then dragupdate panel
Update panel needs two things , one is the control/object which we dont want to cause post back second is trigger of the control that causes it post back ,update progress will show the time consumed animation or some text while the control is processing
here is the sample
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<asp:RadioButton ID="btn1" runat="server" Text="1" GroupName="MyGroup1" AutoPostBack="true" Checked="true" />
<asp:RadioButton ID="btn2" runat="server" Text="2" GroupName="MyGroup1" AutoPostBack="true" />
<asp:UpdateProgress ID="MyUpdateProgress" runat="server" AssociatedUpdatePanelID="MyUpdatePanel">
<asp:UpdatePanel ID="MyUpdatePanel" runat="server" ChildrenAsTriggers="false" UpdateMode="Conditional">
<asp:Label ID="lblTime" runat="server" />
<asp:AsyncPostBackTrigger ControlID="btn1" EventName="CheckedChanged" />
<asp:AsyncPostBackTrigger ControlID="btn2" EventName="CheckedChanged" />
Nov 06, 2011 10:57 AM|LINK
Nov 07, 2011 02:12 AM|LINK
Hi, Pleas erefer this
Nov 10, 2011 02:02 PM|LINK
Thanks umairaslam, salman behera and chetan sarode. All those websites were really helpful. Thanks a lot. I didn't know there were so many ways of doing this...