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

[Solved] Grid/User Control Edit Form and RegisterStartupScript

1 Answer 140 Views
Grid
This is a migrated thread and some comments may be shown as answers.
spt
Top achievements
Rank 1
spt asked on 15 Jul 2009, 09:26 AM
I have a page with ajaxified RadGrid.

 

 <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" ClientEvents-OnRequestStart = "mngRequestStarted">    
<AjaxSettings> 
<telerik:AjaxSetting AjaxControlID="RadGrid1">  
<UpdatedControls> 
<telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1"/>  
</UpdatedControls> 
</telerik:AjaxSetting></AjaxSettings></telerik:RadAjaxManager>    
 
<telerik:RadGrid ... >
   
 ..........
 </telerik:RadGrid ... >
 

 

 

 

EditFormSettings are the following:

 

<EditFormSettings UserControlName="Controls/EditRate.ascx" EditFormType="WebUserControl">  
 

In EditRate.ascx.cs I try to add a startup java-script by the following way. 

 

 

protected void Page_Load(object sender, EventArgs e)     
{  
ScriptManager.RegisterStartupScript(RadAjaxManager.GetCurrent(Page), typeof(Page), "DualListScript"
"MetaBuilders_DualList_Init();"true);    
 }  
 
 

 

 

 When I click on the Edit icon in the grid row, edit user control is loaded, but 

 

 

MetaBuilders_DualList_Init() is not included to the page source. What I am doing wrong?

 

1 Answer, 1 is accepted

Sort by
0
Nikolay Rusev
Telerik team
answered on 20 Jul 2009, 11:54 AM
Hello Igor,

The script you provide as argument on ScriptManager.RegisterStartupScript will be executed whenever document is loaded. This means that your script should be included on the page already.
For your convenience I am attaching sample project demonstrating this. Please find it attached to this post.

Sincerely yours,
Nikolay
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
Grid
Asked by
spt
Top achievements
Rank 1
Answers by
Nikolay Rusev
Telerik team
Share this question
or