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

RegisterClientScript on AJAX request

3 Answers 107 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
QualiWareUA
Top achievements
Rank 1
QualiWareUA asked on 26 Apr 2008, 08:59 PM
Hello,

I have some Rad controls on my form. Interacting with them does not perform form post back, but AJAX request. Nevertheless I may use RegisterClientScript to do some JavaScript after post back. But as post back is not performed, JavaScript is never executed. How can I overcome this?

3 Answers, 1 is accepted

Sort by
0
Todd Anglin
Top achievements
Rank 2
answered on 26 Apr 2008, 11:17 PM
Vlad-

I assume you're using the Telerik RadAjaxManager to ajaxify your page. Is that correct? If so, you'll find it has a convenient "ReponseScripts" collection that allows you to add JavaScript that should be fired after the Ajax operation completes. The JavaScript can be added on the server during the Ajax callback and then it will be automatically executed by the RadAjaxManager when the callback is done.

Check out the docs for more details:

http://www.telerik.com/help/radcontrols/prometheus/?ajxCustomJavaScript.html

Hope that helps-
Todd
0
QualiWareUA
Top achievements
Rank 1
answered on 27 Apr 2008, 08:41 AM
Hi Todd,

I do not use RadAjaxManager. But anyway thank you. I have already figured out how to accomplish this task. Instead of

page.ClientScript.RegisterStartupScript

it necessary to use static method

ScriptManager.RegisterStartupScript.
0
Todd Anglin
Top achievements
Rank 2
answered on 28 Apr 2008, 03:00 PM
Great. I'm glad you found the solution to your problem. And if you're looking for an easier way to add ASP.NET AJAX to your pages (without all of the messy markup and trigger definitions), definitely check out the RadAjaxManager, too.

-Todd
Tags
General Discussions
Asked by
QualiWareUA
Top achievements
Rank 1
Answers by
Todd Anglin
Top achievements
Rank 2
QualiWareUA
Top achievements
Rank 1
Share this question
or