I was running into some issues trying to get a strongly-typed reference to a master page one of my content pages used; I remember blogging about this at one point in the past, but I want to do it again to remind myself (and anyone else) that may encounter this issue.
If you want to access your master page in a strongly-typed fashion (without the need for late-binding or reflection), simply add this to your content page's .aspx file:
<%@ MasterType VirtualPath="
<virtual_path_to_your_master_page>.master" %>
You can then access all the properties, methods, etc. that you have added to your master page without late-binding and other such nasties. Visual Studio can be retarded at times and fall behind in terms of intellisense until you recompile the solution. The end-effect looks like this, then:
Me.
Master.<whatever>()
An interesting side-effect of this is that if you reference a particular type in your master page file and that isn't referenced by the content page (such as a user control [.ascx file]), you can get a compiler error that looks like this:
Error 1 c:\blah\blah.aspx.vb(23): error BC30652: Reference required to assembly 'App_Web_lyipwsg9, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' containing the type 'blah.blah'. Add one to your project. c:\blah\blah.aspx.vb 1
The reason is you now expose types through get/set properties, return values or parameters utilized by your master page file to the content page. The above compiler error is a bit weird to look at and doesn't make sense at first glimpse. To fix this, reference those types in your content (.aspx) pages the same way you reference them in your master (.master) files.