CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML

Free Download:




Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.master_pages_themes_and_navigation_controls Tags:
Item Type: NewsGroup Date Entered: 11/5/2007 5:51:12 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 4 Views: 17 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
5 Items, 1 Pages 1 |< << Go >> >|
prabirshrestha
Asp.Net User
Master page with unequal number of contentplaceholders.11/5/2007 5:51:12 PM

0/0

lets say i have 2 master page;

master1.master contains contentplaceholder1

master2.master contains contentplaceholder1 and contentplaceholder2

default.aspx contains contentplacehoder1 and contentplaceholder2

if my masterpage is set to master2.master everything works fine but how do i prevent an error when masterpagefile is set to master1.master.

since in my website the masterpage is set dynamically i would like to prevent the error sayin cannot find contentplaceholder 2 when my .aspx file's masterpagefile=master1.master

 I would basically like to have a default contentplaceholder, if it doesnt find that specified contentplaceholder it would insert those items in the defaul contentplaceholder.

MaineOne
Asp.Net User
Re: Master page with unequal number of contentplaceholders.11/5/2007 11:33:42 PM

0/0

 One solution would be to put 2 ContentPlaceHolders in each MasterPage then on PageLoad event choose which PlaceHolder you choose to use.

If MasterPage 1 then set ContentPlaceHolder1.Enabled=True and ContentPlaceHolder2.Enabled=False

If MasterPage 2 then set ContentPlaceHolder1.Enabled=True and ContentPlaceHolder2.Enabled=True

 

 


[email protected]

prabirshrestha
Asp.Net User
Re: Master page with unequal number of contentplaceholders.11/6/2007 4:19:23 AM

0/0

Well that might have been an option, but im using masterpages to control the skin of the website, so since the masterpages are set dynamically and could be made by anyother person. we don't know exactly how many contentplace holder will be required. so is there any way to put contentplaceholders in masterpage programatically to be on the safer side.

Amanda Wang - M
Asp.Net User
Re: Master page with unequal number of contentplaceholders.11/8/2007 9:27:27 AM

0/0

Hi,

 Base on your description, you want to create a contentplaceholders in masterpage programatically, right?.

Maybe, you can read this artilce: http://www.codeproject.com/useritems/dynamicmaster.asp
It talks how to creating ContentPlaceHolders and Contents programatically.

Hope it helps.


Please remember to mark the replies as answers if they help and unmark them if they provide no help.


Yours sincerely,
Amanda Wang
Microsoft Online Community Support
GeorgeZ
Asp.Net User
Re: Master page with unequal number of contentplaceholders.11/9/2007 11:30:52 AM

0/0

 The counterpart need to exist in master page. Coud you set a hidden contentpalceholder in master1.mast?

5 Items, 1 Pages 1 |< << Go >> >|


Free Download:


Web:
Master page with unequal number of contentplaceholders. - ASP.NET ... Master page with unequal number of contentplaceholders. Last post 11-09-2007 6: 30 AM by GeorgeZ. 4 replies. Sort Posts: ...
Master page with unequal number of contentplaceholders. - ASP.NET ... Master page with unequal number of contentplaceholders. Last post 11-09-2007 6: 30 AM by GeorgeZ. 4 replies. Sort Posts: ...
Master page with unequal number of contentplaceholders. - ASP.NET ... Master page with unequal number of contentplaceholders. Last post 11-09-2007 6: 30 AM by GeorgeZ. 4 replies. Sort Posts: ...
Master page with unequal number of contentplaceholders. - ASP.NET ... Master page with unequal number of contentplaceholders. Last post 11-09-2007 6: 30 AM by GeorgeZ. 4 replies. Sort Posts: ...
Master page with unequal number of contentplaceholders. - ASP.NET ... Master page with unequal number of contentplaceholders. Last post 11-09-2007 6: 30 AM by GeorgeZ. 4 replies. Sort Posts: ...
Master page with unequal number of contentplaceholders. - ASP.NET ... Master page with unequal number of contentplaceholders. Last post 11-09-2007 6: 30 AM by GeorgeZ. 4 replies. Sort Posts: ...
Master page with unequal number of contentplaceholders. - ASP.NET ... Master page with unequal number of contentplaceholders. Last post 11-09-2007 6: 30 AM by GeorgeZ. 4 replies. Sort Posts: ...
Master page with unequal number of contentplaceholders. - ASP.NET ... Master page with unequal number of contentplaceholders. Last post 11-09-2007 6: 30 AM by GeorgeZ. 4 replies. Sort Posts: ...
Master page with unequal number of contentplaceholders. - ASP.NET ... Master page with unequal number of contentplaceholders. Last post 11-09-2007 6: 30 AM by GeorgeZ. 4 replies. Sort Posts: ...
Master page with unequal number of contentplaceholders. - ASP.NET ... Master page with unequal number of contentplaceholders. Last post 11-09-2007 6: 30 AM by GeorgeZ. 4 replies. Sort Posts: ...




Search This Site:










installed dnn in root, now root redirects to localhost at client

how do i use internal iis instead of built in server

problem with regular expression

how to insert a flash file into asp.net

selectedindexchanged event not triggering

how to check if cached web form exist in the iis server?

ibs portal vs dotnetnuke

system.security.cryptography.cryptographicexception: padding is invalid and cannot be removed

updating the aspnet_roles table with a custom sproc

adding user credentials to web.config

question regarding ending session

dynamic form for survey system

install with vs2003

how can i capture the event of "<a href=\"freetextbox.rar\"></a>" in serverside

formatting a layout using asp.net

the global.asax.cs

switch / case statements

how to do an .aspx page refresh

evaluate asp.net code stored in db table

how to use certificates...

nested wizard control: having sub-steps in a 2.0 wizard control

how to custom textfield?

hard and soft inventory clientside

how can i create a new role in dotnetnuke?

registration page

calendar control

how can i create login and logout?

string manipulation problem

mailmessage.bodyencoding = "utf-8" results in "windows-1252" in mail message

web.sitemap title gets capitalized?

 
All Times Are GMT