Re: Change Content page from Master page



On Jul 3, 7:51 am, "Murray" <mdweingar...@xxxxxxxxx> wrote:
Forgive me if this question is too basic, but I'm new to ASP.NET
programming, and I can't locate a simple answer to this question.
I have a web page that consists of a Master Page and a single
contentplaceholder.
The master page has a menu bar in it.
How do I change the web page that is displayed in the contentplaceholder
when I click on a menu item on the master page?
It seems like this should be pretty basic, but I can't discover how to do
this.
Thanks for any help

First off, you never actually browse to a master page, you browser to
a page that uses a master page. With that said, your scenario is
greatly simplified. Basically if you need to switch from one page to
another, you do just what you would do if you didn't use master pages
- drop a link to that page. The most common ways of doing this are
below.

i.e.

In html:
<a href="NewPage.aspx">Transfer to a New Content Page</a>

From Server-Side Code:
Response.Redirect("NewPage.aspx")
Server.Transfer("NewPage.aspx")

What you have to remember is that master pages are there to make your
life easy. If all your pages share a common template, such as a header
banner and a footer copyright notice, you can put it in your master
page and not have to worry about it at the page level.

Thanks,

Seth Rowe [MVP]
http://sethrowe.blogspot.com/
.



Relevant Pages

  • Re: Master pages, how to make them work?
    ... I still don't see how a Master page can dynamically using different content ... ContentPlaceHolders to set and/or obtain values in the reference pages? ... in each table cell has ContentPlaceHolder (IDs, cph_Header, ... very frustrated with complete lack of useful documentation that doesn't ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Dynamically Adding Content to Nested Master Pages
    ... Its Master Page is set to ... M2master has one ContentPlaceHolder. ... LeftContentArea is always nothing so the load fails. ... will then display a Web User Control. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: LeftPanel
    ... Hi Thom, ... Microsoft Online Support ... |>> On a master page I have three panels and a ContentPlaceHolder. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Can not drag controls onto the design view of a page
    ... it should - that is combined with the master page. ... I copy an .aspx and the .aspx.vb page from the my solution into the ... I cut the ContentPlaceHolder out of my file and paste it right after the ...
    (microsoft.public.dotnet.framework.aspnet)
  • Dynamically Adding Content to Nested Master Pages
    ... Its Master Page is set to ... M2master has one ContentPlaceHolder. ... LeftContentArea is always nothing so the load fails. ... will then display a Web User Control. ...
    (microsoft.public.dotnet.languages.vb)