Change Content page from Master page

M

Murray

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
 
C

Christiano

if i'm not wrong...

when you click the menu, you should open a new link...

thsi new link might inherit the master page...
the contentplaceholder, then, is re-written with the new content of the
new page...

if you have some itens static in the master page, and then the new
content, you can use a multiview control, that the link in menu changes the
views... in each view is placed the link to the new page...


Personally i don't like very much of master pages.. i'd rather use user
controls... in VS2005 it's very easy, because when you import it, it comes
with the visual (VS2003 doens't come with it, just a silver square).



c ya,
christiano.
 
R

rowe_newsgroups

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/
 
C

Cor Ligthert[MVP]

Just set the URL in your menu bar from the page you have as content in your
masterpage.

Cor
 
M

Murray

Let's say my menu bar on the master page has 3 items - just to give them
names: Page1, Page2, and Google
Page1 and Page2 refer to aspx pages that are content pages using my
MasterPage. When I click on them, I Response.Redirect to Page1.aspx or
Page2.aspx. No problem there. I still have my menu bar at the top of the
page, and the page content below it.
However, I want to be able to click on Google and go, for example, to the
google.com web site, still showing my menu bar at the top of the page, with
google.com below it. Is there a simple way to do that? I can easily redirect
to google.com, but then my menu bar is gone, and I have to use the 'Back'
button on my browser to get back to it. When I used Microsoft FrontPage to
create a web page, I could designate a particular frame to display
google.com instead of re-drawing the entire page. I don't see how to
accomplish the equivalent in ASP.NET

Once again, thanks for taking the time to help
 
C

Cor Ligthert[MVP]

Murray,

You are now going outside the meaning of ASPNET which is in fact a dialog
driven application.

Things like you want are more for Expression Web (a wider version for the
formally called tool frontpage).

In that you can use the HTML functions as Seth showed and then set if you
want the page full page or in a frame.
However, this is then not a topic of this newsgroup.

Maybe is your confusion that you compare a MasterPage with a HTML frame or
Iframe, that it is not.

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top