Geeks With Blogs
Phil Sando

Exposing the property:

  
    Public Property stringproperty() As String
        Get
            Return _stringproperty
        End Get
        Set(ByVal value As String)
            _stringproperty = String.empty
        End Set
    End Property

Accessing the property from a content page:

You will need to add this line to your .aspx page in order to be able to access the property you just exposed

@ MasterType VirtualPath ="~/yourmasterpagename.master" %>

You will then be able to access the property programatically from your content page like this;

Master.stringproperty = foo

Posted on Wednesday, February 10, 2010 10:46 AM | Back to top


Comments on this post: Adding properties to an asp.net masterpage

No comments posted yet.
Your comment:
 (will show your gravatar)


Copyright © PhilSando | Powered by: GeeksWithBlogs.net