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

ResponseScripts only works once

1 Answer 129 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Roger
Top achievements
Rank 1
Roger asked on 10 Jul 2008, 06:02 AM
Hi,

I have a radAjaxManager in a Master page and in my content code-behind in a RadGrid update I am conneting to it via:

Dim ajx As Telerik.Web.UI.RadAjaxManager = CType(Me.Master.FindControl("RadAjaxMaster"), Telerik.Web.UI.RadAjaxManager)

then I need to run a script on the content page if a certian condition is met in the code-behind using:

ajx.ResponseScripts.Clear()
ajx.ResponseScripts.Add(

"GridReturn();")

This works well the first time but every time after that I get an "Error on page" in the status bar of the browser.

Similar thing happens when I use:

ScriptManager.RegisterStartupScript(

Me, Me.GetType, "foo", "GridReturn();", True)

How can I get the script to run when required?


Regards

1 Answer, 1 is accepted

Sort by
0
Roger
Top achievements
Rank 1
answered on 11 Jul 2008, 12:18 AM
Hi,

I found the problem....on my old version of RadGrid I had the radgrid.responsescripts procedure but now with the new version, the ajaxification has been removed to the manager.

I had updated my code to RadAjaxManager.ResponseScripts.Add("gridReturn();")

but had not updated the RadAjaxManager to include itself in the AjaxSetting collection.

Once I did this everything works perfectly.

Regards
Tags
Ajax
Asked by
Roger
Top achievements
Rank 1
Answers by
Roger
Top achievements
Rank 1
Share this question
or