Quantcast
Channel: Off-Topic Posts (Do Not Post Here) forum
Viewing all articles
Browse latest Browse all 14169

Asp.net MasterPage and Controls reference

$
0
0

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


Viewing all articles
Browse latest Browse all 14169

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>