Calling RegisterPostBackControl from a usercontrol (ascx)

3 posts, 0 answers
  1. Andy
    Andy avatar
    11 posts
    Member since:
    Nov 2010

    Posted 17 Jun 2011 Link to this post

    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. Helen
    Admin
    Helen avatar
    1052 posts

    Posted 23 Jun 2011 Link to this post

    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.

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Andy
    Andy avatar
    11 posts
    Member since:
    Nov 2010

    Posted 28 Jun 2011 Link to this post

    Yes, it worked without the ".Page"

    Thank you
Back to Top