CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Content Pages

  1. #1
    Join Date
    Apr 1999
    Location
    Galway, Ireland
    Posts
    96

    Content Pages

    VS2005 Team Edition - C#

    I'm new to using a master pages and have noticed odd behavior adding content pages. As far as I know, you right click the master page and select Add Content Page. This creates a new aspx and codebehind file without prompting for a name. So this forces me to perform the following steps every time I add a content page:

    • Rename the aspx page (which renames the codebehind file)
    • Change the class name in the code behind file
    • Change the Inherits tag to the class in the aspx header


    Seems like a lot of work doesn't it? Is there a better way?
    Lounge One-Eleven Presents: Gong! v2.0 - you never knew you needed it until you lived without it

  2. #2
    Join Date
    Mar 2004
    Location
    Prague, Czech Republic, EU
    Posts
    1,701

    Re: Content Pages

    Yes, it is. You have not to use visual tools everywhere. You can simply define content place holder element in master page by hand in html source and assign a identifier to it. Than if you have a page (aspx) which you want to content of master page, edit html source again, define content element and set its id to the identifier. You can do it all by hand and I believe it is faster.
    • Make it run.
    • Make it right.
    • Make it fast.

    Don't hesitate to rate my post.

  3. #3
    Join Date
    Apr 1999
    Location
    Galway, Ireland
    Posts
    96

    Re: Content Pages

    Ok I found the way we're meant to do it:

    New Item->Web Form and there is a checkbox near the bottom which says "Select Master Page".

    Easy-peasey-lemon-squeezy !
    Lounge One-Eleven Presents: Gong! v2.0 - you never knew you needed it until you lived without it

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured