locked
Asp.net MasterPage and Controls reference RRS feed

  • Question

  • Hi, I have a question on how to call methods implemented all the way on Baseform/MasterPage.

     Say I have a MasterPage (or BaseForm), and it has a method -- Refresh

    Now I have a Page1.aspx that is derived from BaseForm.  And inside this Page1.aspx, it contains a control UserCtrl1.

    Inside the UserCtrl1, when user have checked a checkbox, I want to call the REFRESH method all the way in the BaseForm.

    Since I put all of them inside the same name space and project, can I make the call from INSIDE the UserCtrl1 class like:

    *My BaseForm NameSpace/ClassName is : Investigations.BaseFormInvestigation

    if ( Page is Investigations.BaseFormInvestigation && ((Investigations.BaseFormInvestigation)Page).IsDirty)

       {

                 ((Investigations.BaseFormInvestigation)Page).Refresh();

       }

    )

    This code works and is conveniently simple.. but i want to make sure it is good practice?

    Thank you so much

    • Moved by Caillen Tuesday, May 13, 2014 9:08 AM
    Monday, May 12, 2014 6:23 PM

Answers