Help Needed with Master Pages in ASP.NET 3.5

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • pmfphd@gmail.com

    Help Needed with Master Pages in ASP.NET 3.5

    I have just started working with ASP.NET 3.5 and Visual Studio 2008
    and I am having a problem. I am using a master page for my project
    and I have set up two Public Properties on that page that need to be
    set on each content page that is built based on it. I am using this
    line of code in the content page so I can access the properties on the
    master page:

    <%@ MasterType VirtualPath="~/Registration.Ma ster" %>

    The error I keep getting whenever I make even the most trivial change
    to the content page is in the .aspx.designer. vb file (for example,
    Default.aspx.de signer.vb). The code it generates looks like this:

    '''<summary>
    '''Master property.
    '''</summary>
    '''<remarks>
    '''Auto-generated property.
    '''</remarks>
    Public Shadows ReadOnly Property Master() As
    Registration.Re gistration
    Get
    Return CType(MyBase.Ma ster, Registration.Re gistration)
    End Get
    End Property

    The error is the Registration.Re gistration portion. The code should
    read just Registration, not Registration.Re gistration. Once I change
    the code back the page works correctly. Is there something I'm doing
    wrong that is causing this error or is this a bug in Visual Studio?

    Thanks,
    Paul M. Frazier
    paul.frazier@ec otoh.org
  • Mr. Arnold

    #2
    Re: Help Needed with Master Pages in ASP.NET 3.5


    <pmfphd@gmail.c omwrote in message
    news:7b15bbf7-9cfa-447d-b0fb-6e973edadbf2@e3 9g2000hsf.googl egroups.com...
    >I have just started working with ASP.NET 3.5 and Visual Studio 2008
    and I am having a problem. I am using a master page for my project
    and I have set up two Public Properties on that page that need to be
    set on each content page that is built based on it. I am using this
    line of code in the content page so I can access the properties on the
    master page:
    ms.public.dotne t.framework.asp net

    Comment

    • Cor Ligthert[MVP]

      #3
      Re: Help Needed with Master Pages in ASP.NET 3.5

      Mr, Arnold,

      In my idea is this a question about the language VB in dot Net.

      Cor

      "Mr. Arnold" <MR. Arnold@Arnold.c omschreef in bericht
      news:ep3d%23ndx IHA.3680@TK2MSF TNGP05.phx.gbl. ..
      >
      <pmfphd@gmail.c omwrote in message
      news:7b15bbf7-9cfa-447d-b0fb-6e973edadbf2@e3 9g2000hsf.googl egroups.com...
      >>I have just started working with ASP.NET 3.5 and Visual Studio 2008
      >and I am having a problem. I am using a master page for my project
      >and I have set up two Public Properties on that page that need to be
      >set on each content page that is built based on it. I am using this
      >line of code in the content page so I can access the properties on the
      >master page:
      >
      ms.public.dotne t.framework.asp net

      Comment

      • Cor Ligthert[MVP]

        #4
        Re: Help Needed with Master Pages in ASP.NET 3.5

        The purpose of the designer vb part is that you don't change it (and in a
        way is the partial class created for that, so that it is seperated from the
        rest of the code).

        As you want to change code do it then in the partial class (in ASPNET mostly
        called code behind) of your code.

        Cor

        <pmfphd@gmail.c omschreef in bericht
        news:7b15bbf7-9cfa-447d-b0fb-6e973edadbf2@e3 9g2000hsf.googl egroups.com...
        >I have just started working with ASP.NET 3.5 and Visual Studio 2008
        and I am having a problem. I am using a master page for my project
        and I have set up two Public Properties on that page that need to be
        set on each content page that is built based on it. I am using this
        line of code in the content page so I can access the properties on the
        master page:
        >
        <%@ MasterType VirtualPath="~/Registration.Ma ster" %>
        >
        The error I keep getting whenever I make even the most trivial change
        to the content page is in the .aspx.designer. vb file (for example,
        Default.aspx.de signer.vb). The code it generates looks like this:
        >
        '''<summary>
        '''Master property.
        '''</summary>
        '''<remarks>
        '''Auto-generated property.
        '''</remarks>
        Public Shadows ReadOnly Property Master() As
        Registration.Re gistration
        Get
        Return CType(MyBase.Ma ster, Registration.Re gistration)
        End Get
        End Property
        >
        The error is the Registration.Re gistration portion. The code should
        read just Registration, not Registration.Re gistration. Once I change
        the code back the page works correctly. Is there something I'm doing
        wrong that is causing this error or is this a bug in Visual Studio?
        >
        Thanks,
        Paul M. Frazier
        paul.frazier@ec otoh.org

        Comment

        Working...