CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums

MS SQL 2008 on ASP.NET Hosting



Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.master_pages_themes_and_navigation_controls Tags:
Item Type: NewsGroup Date Entered: 4/25/2007 12:00:33 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 2 Views: 32 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
3 Items, 1 Pages 1 |< << Go >> >|
yamadhrama
Asp.Net User
Programitically set the masterpage to NULL4/25/2007 12:00:33 PM

0/0

Hello,

I have asp.net application which has 1 master page. All the other pages are based out this master page.

For one of the child pages, I need to set the masterpage to "null"  based on a condition so that page becomes a "normal asp.net page" not a content page

Can this be done ??

Regards

 

bpag
Asp.Net User
Re: Programitically set the masterpage to NULL4/25/2007 1:03:49 PM

0/0

I don't see how you're going to be able to accomplish this. Your content page is, necessarily, not a full page but just some content controls that link back to the contentplaceholders on the master. If you remove the master then you have content controls that link back to nothing and no <html> <head> <body> <form> tags just a bunch of loose html. One thing you can do is create a second master with the look and feel you want for this particular page when you want it to be a "normal asp.net page" and with contentplaceholders with the same ids as the ones in the main master. Then in Page_Init of this content page you check the condition and if you want the page to be a "normal asp.net page" you set the master to point to this second master page otherwise you leave it pointing to the regular master page.

Another thing you can do (which is not exactly what you are talking about but sort of mimics it) is to put all the content for this particular page into a user control. Then you put the user control in your content page and you also create a second regular asp.net page that uses this same user control. During your Page_Init or Page_Load of the content page you check the condition and based on that either keep loading the page or if you need the "normal asp.net page" you can redirect to the normal page that ha sthe user control in it.

 


If this post answered your question please remember to 'Mark as Answer'!
yamadhrama
Asp.Net User
Re: Programitically set the masterpage to NULL4/26/2007 9:54:50 AM

0/0

 Hello

Thanks for the ans..

I think i have got it now

Regards

 

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


Free Download:

Books:
Pro ASP.NET 2.0 in C# 2005 Authors: Matthew MacDonald, Mario Szpuszta, Pages: 1255, Published: 2005
Core Internet Application Development with ASP.NET 2.0 Authors: Randy Connolly, Pages: 1049, Published: 2007
Pro ASP.NET 2.0 in C# 2005: Create Next-generation Web Applications with the Latest Version of Microsoft's Revolutionary Technology Authors: Matthew MacDonald, Mario Szpuszta, Pages: 1426, Published: 2006
Pro ASP.NET 3.5 in C# 2008 Authors: Matthew MacDonald, Mario Szpuszta, Pages: 1498, Published: 2007
ASP.NET 2.0 MVP Hacks and Tips Authors: David Yack, Joe Mayo, Scott Hanselman, Fredrik Normén, Dan Wahlin, J. Ambrose Little, Jonathan Goodyear, Pages: 400, Published: 2006

Web:
How To? Programmatically Set Theme For Master Page programmatically set a theme for a master page? ... null && preferredTheme. Length > 0) { //Set the preferred theme ...
How To? Programmatically Set Theme For Master Page - .NET ASP I have tried to programmatically set the theme for my master page by ... null && preferredTheme.Length > 0) { //Set the preferred theme ...
Specifying the Master Page Programmatically : The Official ... To set the master page programmatically, then, we can either create an event ..... null) return "~/Site.master"; else return Session["MyMasterPage"]. ...
Master Pages :: Specifying the Master Page Programmatically ... To set the master page programmatically, then, we can either create ..... if ( Session["MyMasterPage"] == null). return "/Site.master"; ...
Interacting with the Master Page from the Content Page : The ... Specifically, we need to set the master page's GridMessageText property and call its ... If the page does not have a master page Master returns null . ...
How to: Apply ASP.NET Themes Programmatically When using Master Pages it doesn't quite work correctly; all the controls are null. You need to set the Master page then the controls are available. ...
ASP.Net 2.0 - Master Pages: Tips, Tricks, and Traps Apr 11, 2006 ... FindControl is fragile, and will return null if someone renames ...... We know we will need to set the master page before or during the ...
Simon Evans' Blog : How to programmatically assign a SkinID to a ... Now, what happens if you try this applying a masterpage at the same time? You get an "object reference not set to an instance of an object" exception, ...
Centralize Master page and Alternate CSS settings - Sander's Blog Aug 29, 2008 ... To achieve this I want to use a HttpModule to set the Masterpage and alternate CSS ... null) { page.PreInit += page_PreInit; } } static void ...
CodeGuru: An In-Depth Coverage of ASP.NET 2.0's Master Pages: Part ... null) { //Set content page title to master page control Title.Text = mpLabel. Text }. Note: Master pages can contain ContentPlaceHolder controls that ...




Search This Site:










unable to authen webservice in same server

published site logincontrol/db issue.

security exception

rules

login control problem

get the userid being stored in the sql database

page permission

how to configure programming the authentication mode?

unlock a member

active directory membership - get all users list?

wat cannot automatically create membership database

windows 2003 asp.net server to a win 2k sql box

accessing network drives (me crazy)

getting providertoolkitsamples working

authorization for usertype

unable to show/hide different nodes of a treeview control by using stiemap

adding properties to the user object

wsat for users?

redirect problem

how do you configure the creator wizard to asign a role to new user

restricting access to pdf files on a webpage

ownership problem

createwebuser control

roles based authentication

problem authenticating user onto web service using active directory

membership provider

redirect on login based on profileprovider value?

login server.transfer not working

login control with master page

how to get email address from username

  Privacy | Contact Us
All Times Are GMT