Updating Parent Control from Child User Control

3 posts, 0 answers
  1. RJ
    RJ avatar
    386 posts
    Member since:
    Oct 2006

    Posted 25 Mar 2015 Link to this post

    Hi All,
    Just wondering how can I update parent control from child user control?
    Here's the structure of my Page
    Master Page
        Parent Aspx with my radmenu
             User Control with button.

    When I click on my button it updates my radmenu when theres postback,
    but when its ajaxified my radmenu wont update.

    Any code I could use to link child to update parent control with Ajax.

    Thanks in advance,
    RJ
  2. RJ
    RJ avatar
    386 posts
    Member since:
    Oct 2006

    Posted 25 Mar 2015 Link to this post

    This code doesn't work for me.
    'Get the WebUserControl
        Dim MyControl As UserControl = CType(Page.FindControl("WebUserControl1"), UserControl)

        'Get user control's button and label
        Dim MyButton As Button = CType(MyControl.FindControl("Button1"), Button) ---> Error on this line. NullReferenceException
        Dim MyLabel As Label = CType(MyControl.FindControl("Label1"), Label)

        'Add the necessary AJAX setting programmatically
        RadAjaxManager1.AjaxSettings.AddAjaxSetting(MyButton, MyLabel)
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. RJ
    RJ avatar
    386 posts
    Member since:
    Oct 2006

    Posted 25 Mar 2015 Link to this post

    Was able to make it work.
Back to Top