Wrox Programmer Forums
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 20th, 2006, 12:32 PM
Registered User
 
Join Date: Jul 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default MasterPages Help!

Hi! i'm newbie in masterpages....
This is my problem. I´m trying to make a masterpages with a header,footer and in the middle i want in the left to load an menu page (dinamycally loaded from database checkeing the user profile) and in the right of that the specific page content.
I think i need to put two contentplaceholders in the masterpage, and in the left one load the menu page, and in the right one put the specific page content that i want.
Where i say that in the left one i want to load the menu.aspx page? because if i do drag and drop from solution explorer it puts a link to de page, and that's not what i want.
Another question...why i can't resize the contentplaceholder? i'm putting it in a table and the cell it's bigger than the placeholder, but i can't resize it...
Thanks in advance. Guillermo.

 
Old March 24th, 2006, 12:05 PM
Registered User
 
Join Date: Mar 2006
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I managed to get this to work by creating a masterpage with a contentplaceholder. I then created a web user control which got the navigation items I needed & placed them into another placeholder on the web user control (called nav_plc in the code below). The user control was then put into the master page content placeholder.

The code for the web user control got the the id & name of the pages I wanted to link to & put a literal control on the page for each of them:

while(dr.read())
{
   LiteralControl newLiteral = new LiteralControl();
   nav_plc.Controls.Add(newLiteral);
   newLiteral.Text = "<a href='" + whatever url it is, + stuff from your database " +"</a><br />";
}


So the MasterPage had a ContentPlaceHolder in it, which had WebUserControl.
The WebUserControl had a PlaceHolder (nav_plc) to which I added literal controls.

There's probably simpler ways of doing this (if anyone knows of any I'd love to know myself). But it did work.

Hope this helps.







Similar Threads
Thread Thread Starter Forum Replies Last Post
masterpages, contentplaceholder, formview, button miltonsnider ASP.NET 2.0 Basics 5 December 4th, 2007 01:17 PM
Question about masterpages Kjella BOOK: Professional ASP.NET 2.0 Design: CSS, Themes, and Master Pages ISBN: 978-0-470-12448-2 3 November 29th, 2007 11:42 AM
error in source while using masterpages dotnetuser ASP.NET 2.0 Basics 4 June 28th, 2007 08:10 AM
Problems with MasterPages gobotsoup ASP.NET 2.0 Basics 2 March 7th, 2007 11:48 AM
MasterPages ContentPages and Meta tags michaelcode ASP.NET 2.0 Basics 5 June 1st, 2006 04:13 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.