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

[Solved] Ajaxified Button and RegisterStartupScript don't work properly

1 Answer 93 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
wnl
Top achievements
Rank 1
wnl asked on 11 Aug 2009, 07:35 AM
Hi,
in my project I'm using RadAjaxManager:
protected void Page_Load(object sender, EventArgs e)  
        {  
            RadAjaxManager1.AjaxSettings.AddAjaxSetting(Button2, Button2);  
              
        } 
I have a button with click event:
protected void Button2_Click1(object sender, EventArgs e)  
        {  
           ClientScript.RegisterStartupScript(Page.GetType(), "mykey""CloseAndRebind();"true);  
        } 
In this  case my js script "CloseAndRebind" doesn't work.
But when I remove:
RadAjaxManager1.AjaxSettings.AddAjaxSetting(Button2, Button2);   
the code works fine. Why?
I have to ajaxified Button2.

1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 12 Aug 2009, 08:07 AM
Hello Jaromin,

I recommend you use the ScriptManager's static methods (RegisterStartupScript/RegisterClientScriptBlock) instead.
ScriptManager Class

Regards,
Daniel
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Ajax
Asked by
wnl
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or