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

[Solved] Append script to RadScriptBlock from code behind

1 Answer 284 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
guillaume.lebel
Top achievements
Rank 1
Iron
Iron
guillaume.lebel asked on 14 Oct 2009, 09:41 PM
Hi,

I have a page where i need to create client object from code behind. All my page is currently ajaxified, but i can't retrieve correctly the object in my page. When i remove all ajax in my page my client script works well.

I know the radscriptblock might be a good solution for my page but i don't know if it's possible to add dynamicly script from code behind in the radscriptblock in the page_prerender.

Thx for your time!

Guillaume

1 Answer, 1 is accepted

Sort by
0
Iana Tsolova
Telerik team
answered on 20 Oct 2009, 06:48 AM
Hi Guillaume,

Could you please paste the Page_PreRender handler where you register the script on the page here so we could check it out? It should look like the below:

protected void Page_PreRender(object sender, EventArgs e)
{
    string script = "function DoThis() { alert('this'); }";
    ScriptManager.RegisterStartupScript(Page, typeof(Page), "script", script, true);
}


Kind regards,
Iana
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Ajax
Asked by
guillaume.lebel
Top achievements
Rank 1
Iron
Iron
Answers by
Iana Tsolova
Telerik team
Share this question
or