This is a migrated thread and some comments may be shown as answers.

postback issue on page load

2 Answers 92 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Todd A
Top achievements
Rank 1
Todd A asked on 25 May 2011, 07:14 PM

We are using RadScriptManager with the Ajax Proxy.  We are experiencing some issues if users are quick to press buttons (I am thinking prior to the page completely loading).

For example,

The below code will do a postback if clicked quickly versus if you wait for the page to fully load.  If you wait for the page to fully load it does what it's suppose to do, and just run the local javascript.

 

 

 

<telerik:RadButton id="addLocationButton" runat="server" text="Add Location" width="100" OnClientClicked="UpdateQuickPanel" AutoPostBack="false" />

Do you have any ideas what is causing this behavior and how to prevent it?

Thanks,
Todd.

2 Answers, 1 is accepted

Sort by
0
Vasil
Telerik team
answered on 26 May 2011, 03:42 PM
Hi Todd,

Check the UpdateQuickPanel JavaScript function that you call on client click of the addLocationButton. If there is some error in the function, a full post-back will happen.
Make sure that all scripts that are used in this function are loaded by the time that you click on the button, otherwise a JavaScript error could occur and brake your Ajax call.

Greetings,
Vasil
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Todd A
Top achievements
Rank 1
answered on 26 May 2011, 07:01 PM
I put a try catch block within the method and in initial tests appears to be working -- it doesn't postback.  I don't do much in the javascript but get an element and change the value -- so I'm guessing the element has not been loaded yet.  I'll go with this for now -- thanks for the help.

Thanks,
Todd.

 

Tags
Ajax
Asked by
Todd A
Top achievements
Rank 1
Answers by
Vasil
Telerik team
Todd A
Top achievements
Rank 1
Share this question
or