[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1903
  • Last Modified:

How to access the public variable MasterPage template in the aspx or ascx page

How to access the public variable MasterPage template in the aspx or ascx page

I will really appreciate and VB.Net code examples

Thanks
0
shieldguy
Asked:
shieldguy
  • 2
1 Solution
 
shahprabalCommented:
Could you clarify a little... are you looking to access a variable thats in your masterpage?
0
 
shieldguyAuthor Commented:
Yes the variable is in my Master page .. How can I access it

Thanks
0
 
shahprabalCommented:
A good article with examples :

http://aspnet.4guysfromrolla.com/articles/013107-1.aspx

"To access the Master Page's methods or properties from a content page, reference the Master Page through the Page.Master property. This property returns an object of type MasterPage, so you'll need to explicitly cast it to the appropriate type before calling its methods or referencing its properties. Alternatively, you can set the @MasterType directive, which adds a property to the auto-generated ASP.NET code-behind class code named Master that is a strongly-typed reference to the specified Master Page. "
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now