asp.net - How to access an enum in master page -


Can we use an enum that is defined in the master page? I read about the master page on my blog.

If you have an actual enum , defining it elsewhere is a better option , But the same functioning given below also works to get it.

If you want to use the property that enum then enter your page's master property on the type of your master page like this: / P> Secure Zero Override OnLoad (EventAGRS E) {(MyMasterPagesType Master). MyEnumProperty = MyEnum.Value; }

Edit:

Almost forgotten, you may also have a master property on your page, These types of behaviors are performing as your ASPX markup.

  & lt;% @ MasterType VirtualPath = "~ / masters / SourcePage.master" "%>  

Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -