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

Calling RegisterPostBackControl from a usercontrol (ascx)

2 Answers 136 Views
ScriptManager and StyleSheetManager
This is a migrated thread and some comments may be shown as answers.
Andy
Top achievements
Rank 2
Andy asked on 17 Jun 2011, 09:26 PM
I have just move a grid from a page to a usercontrol. Since the scriptmanager is at the page level, I'm not sure how to reference it to run the following piece of code in my grid's PreRender:

for (int i = 0; i <= ShotDetail_RadGrid.MasterTableView.Items.Count - 1; i++) {
    Panel aspPanel = ShotDetail_RadGrid.MasterTableView.Items(i).ChildItem.FindControl("InnerContainer");
    RadGrid attachmentsGrid = aspPanel.FindControl("Attachments_RadGrid");
    RadScriptManager1.RegisterPostBackControl(attachmentsGrid); // Problem is here
}

I can't find it with Page.FindControl("RadScriptManager1")

Thanks!

2 Answers, 1 is accepted

Sort by
0
Helen
Telerik team
answered on 23 Jun 2011, 10:34 AM
Hi Andy,

You may try something like the following:
ScriptManager1 = (RadScriptManager)this.Parent.Page.FindControl("RadScriptManager1");


Regards,
Helen
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Andy
Top achievements
Rank 2
answered on 28 Jun 2011, 07:06 PM
Yes, it worked without the ".Page"

Thank you
Tags
ScriptManager and StyleSheetManager
Asked by
Andy
Top achievements
Rank 2
Answers by
Helen
Telerik team
Andy
Top achievements
Rank 2
Share this question
or