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

[Solved] RegisterStartupScript Unavailable

3 Answers 167 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Brandon
Top achievements
Rank 1
Brandon asked on 04 Apr 2008, 01:32 PM

Telerik controls are unavailable to javascript when the page's startup script runs. I tried adding the startup script in Page_Load using the following methods:

1.    //Page.ClientScript.RegisterStartupScript(typeof(Page), "addScript", "SetReadOnly();", true);

2.    //RadAjaxPanel1.ResponseScripts.Add("SetReadOnly();");

3.    //RadAjaxManager1.ResponseScripts.Add("SetReadOnly();");

Please let me know what I need to do to access the page's Telerik controls in the startup script.

3 Answers, 1 is accepted

Sort by
0
Pavel
Telerik team
answered on 07 Apr 2008, 07:38 AM
Hello Brandon,

Could you please elaborate what are you trying to achieve? Any further information about your scenario is welcome and will help us better understand how to assist you.

All the best,
Pavel
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Brandon
Top achievements
Rank 1
answered on 10 Apr 2008, 01:30 PM
I need to enable / disable the pages telerik controls via javascript the first time the page loads.
0
Pavel
Telerik team
answered on 14 Apr 2008, 11:26 AM
Hello Brandon,

You can disable the RadAjaxManager client-side using the pageLoad event with the following script:
    <script type="text/javascript"
        function pageLoad() 
        { 
            $find("<%= RadAjaxManager1.ClientID %>").set_enableAJAX(false); 
        } 
    </script> 


As for the RadAjaxPanel there is no way to disable it on the client.
Could you provide more information what is the purpose of disabling the controls? Maybe we could suggest another approach if the end result is known to us.

All the best,
Pavel
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
General Discussions
Asked by
Brandon
Top achievements
Rank 1
Answers by
Pavel
Telerik team
Brandon
Top achievements
Rank 1
Share this question
or