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/20/2007 8:05:18 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 2 Views: 30 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
3 Items, 1 Pages 1 |< << Go >> >|
ersheido
Asp.Net User
Applying Theme programmatically to all pages11/20/2007 8:05:18 PM

0/0

I have a need to allow users to select the theme you want to use and save in their profile.  I am aware of the ability to set the them for individual pages and have a function to do so (see below):

 

Protected Sub Page_PreInit(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreInit

Dim strTheme As String = DataManager.GetUserTheme(User.Identity.Name.ToString)

If Theme <> Nothing Then

Page.Theme = strTheme

End If

End Sub

However, I have not been able to find a way to set the Theme for all pages so I don't have to add the above code to all the pages on my site.  Furthmore, adding the code to the MasterPages wouldn't work because MasterPages do not have PreInit methods.

Any ideas?  I have see the question asked several times, but it always goes back to setting the theme for individual pages.  What am I missing?

Thanks,

 

ecbruck
Asp.Net User
Re: Applying Theme programmatically to all pages11/20/2007 8:37:38 PM

0/0

Put that code into a Base Page Class which is inherited by all of your web pages.


Thanks, Ed

Microsoft MVP - ASP/ASP.NET

Please remember to 'Mark as Answer' if this post answered your question!
ersheido
Asp.Net User
Re: Applying Theme programmatically to all pages11/20/2007 9:51:59 PM

0/0

Brilliant!  Thanks,

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


Free Download:

Books:
Professional ASP.NET 2.0 Design: CSS, Themes, and Master Pages Authors: Jacob J. Sanford, Pages: 474, Published: 2007
Professional C# 2005 with .NET 3.0 Authors: Christian Nagel, Bill Evjen, Jay Glynn, Karli Watson, Morgan Skinner, Pages: 1748, Published: 2007
Professional C# 2005 Authors: Christian Nagel, Bill Evjen, Jay Glynn, Karli Watson, Morgan Skinner, Allen Jones, Pages: 1540, Published: 2006
Beginning ASP.NET 3.5: In C# and VB Authors: Imar Spaanjaars, Pages: 734, Published: 2008
Professional ASP.NET 2.0 Authors: Bill Evjen, Scott Hanselman, Farhan Muhammad, Srinivasa Sivakumar, Devin Rader, Pages: 1253, Published: 2005
Core Internet Application Development with ASP.NET 2.0 Authors: Randy Connolly, Pages: 1049, Published: 2007
ASP.NET 2.0 Website Programming: Problem-design-solution Authors: Marco Bellinaso, Pages: 576, Published: 2006
ASP.NET 2.0 All-In-One Desk Reference For Dummies: all-in-one desk reference for dummies Authors: Doug Lowe, Jeff Cogswell, Ken Cox, Pages: 910, Published: 2006
Professional ASP.NET 3.5: In C# and VB Authors: Bill Evjen, Scott Hanselman, Devin Rader, Pages: 1673, Published: 2008
Professional C# 2008 Authors: Christian Nagel, Bill Evjen, Jay Glynn, Karli Watson, Morgan Skinner, Pages: 1782, Published: 2008

Web:
How to: Apply ASP.NET Themes Programmatically You can set both page themes and style sheet themes programmatically; however, ... When using Master Pages it doesn't quite work correctly; all the controls ...
SharePoint customization - applying a theme programmatically ... Jun 24, 2008 ... Customizing a site generally means skinning all its pages. ... And there you go - you can programmatically apply a theme to a site. ...
Working with Themes in ASP.NET 2.0: ASP Alliance Listing 2. < /configuration>. Applying Theme to all Applications in a Server ...
K. Scott Allen : Setting An ASP.NET Theme in the PreInit Event Handler All in all we’re just another brick in the wall… [Via: [email protected] ( Rockford ... Here is my solution for applying theme programatically to the whole ...
novolocus.com » Programmatically apply a Default Theme in SharePoint Oct 17, 2008 ... Programmatically apply a Default Theme in SharePoint. As I’ve mentioned before, ... So can you put Web Part Zones in Master Pages, or what? ...
Assigning Themes Programmatically to ascx files - ASP.NET Forums I am trying to assign a theme programmatically to my ascx web user ... used in aspx pages applies the theme correctly, but it does not apply ...
p2p.wrox.com Forums - Applying themes programmatically in asp.net Hi All I dont know how to apply themes to ASP.NET Pages programatically ..... All rights reserved. Please read our Privacy Policy.
Accessing themes/skinid's programmatically using asp.net 2.0 Apr 30, 2008 ... Page theme defines themes for the pages or for entire application, you can apply themes for single page as shown below. ...
DotNet-Intelligent: Themes Aug 24, 2007 ... Applying Themes to Pages A theme can be applied using any one of the ... To apply a theme programmatically, you must specify the Theme ...
How to: Apply ASP.NET Themes Programmatically You can set both page themes and style sheet themes programmatically; however, the procedure for applying each type of theme is different.




Search This Site:










3.0.7 issue - works only with case insensitive db setup

unable to reach the menuitemclick event handler

login problem - dnn 2.04 css skins.

the name xxx does not exist in the current context

dotnetnuke development setup

photos classified starter kit?

password requirement modification

csk with sql express and paypal aspnet user login fail

anybody ever seen this error and know how to resolve?

can access parametrized data from query builder, but not from sqldatasource

what happened to "disable version in page title"?

scraped php and master page that displays improperly

error when uploading file to sub sub directory using file manager

treeview (401) unauthorized

recover username?

large project with multiple subweb projects

using multiple master pages?

how to show code in a blog post?

error logging in after upgrading to 1.0.10c

solpart menu functionality limits?

privacy statement navigation

better app that provides user-configurable table ?

built-in controls with custom providers

heme 'xxx' cannot be found in the application or global theme directories. iis

web service using managed and unmanaged code returns 401.

not automatically collapse thread in discussion module

content sub folders - performance issue for portlets that access files

a footer of masterpage comes overlapped to the contents of sub page.

3.05 password not specified in notification mail to superuser

how to install this?forumblog_03[2].00.00.zip

 
All Times Are GMT