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

Javascript Not Registering in Ajaxified Grid

3 Answers 51 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Oran
Top achievements
Rank 1
Oran asked on 20 Jan 2011, 10:55 AM
Hi,

I have a RadGrid with a template column that uses a user control in the Edit Template. The user control tries to Register a script to run that has a function in it that will be called when the user clicks on the user control. However the function is not properly registered and cannot be called by the user control.

If I remove the RadGrid from the RadAjaxManager everything works fine.

Here is a link to a sample project (zipped) that demonstrates my problem: sample project.

I have looked around on the forums and tried some of the other suggestions to no avail.

Can you please suggest a workaround for this?

Thanks,
Oran

3 Answers, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 20 Jan 2011, 04:49 PM
Hello Oran,

I would suggest you to use the ResponseScripts property of the RadAjaxPanel or RadAjaxManager. Please refer to the following help topic for more information on this matter.

Regards,
Maria Ilieva
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
Oran
Top achievements
Rank 1
answered on 21 Jan 2011, 10:58 AM
Hi Maria,

Thanks for the response.

I can't use the ResponseScripts in my scenario since that is meant to execute a line a of JS as soon as the Ajax request completes. I want to add a JS function to the page that will be executed later when the user clicks on the user control. See the sample project attached.

Thanks,
Oran
0
Maria Ilieva
Telerik team
answered on 26 Jan 2011, 03:12 PM
Hello Oran,


I revise the provided example and was able to replicate the described issue. The reason for the problem you are facing is caused by the fact that after Ajax request each script should be register by the Page, otherwise the ScriptManager will be register them properly. Please modify your script registration to:

ScriptManager.RegisterStartupScript(Page, Page.GetType(), uniqeKey, script, true);

 

Regards,
Maria Ilieva
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.
Tags
Ajax
Asked by
Oran
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
Oran
Top achievements
Rank 1
Share this question
or