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: 3/2/2004 12:21:24 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 2 Views: 29 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
3 Items, 1 Pages 1 |< << Go >> >|
bholland
Asp.Net User
Changing Themes programatically from Master Page3/2/2004 12:21:24 AM

0/0

Is it possible to change a theme from a Master Page?

I have a dropdownlist on a master page and would like to change the theme on the fly.

Any samples would be appreciated.

Here is what I have put in the MasterPage for testing purposes:

Dim Theme As String

Theme = Session("Theme")
If Theme IsNot Nothing Then
Page.Theme = Theme
End If

If DropDownList1.SelectedValue <> "Base" Then
Page.Theme = DropDownList1.SelectedValue
Else
Page.Theme = "Base"
End If


Thanks
Fredrik N
Asp.Net User
Re: Changing Themes programatically from Master Page3/2/2004 5:04:57 AM

0/0

The Theme is applied in the Page PreInit event. You could use the new client call-back feature to add the selected theme from your dropdown into your ?Theme? session.

You have to set the theme in the Page's PreInit event.

For example:


Sub Page_PreInit(Sender As Object, E As EventArgs)

Dim Theme As String

Theme = Session("Theme")
If Theme IsNot Nothing Then

Page.Theme = Theme

End If

End Dub


/Fredrik Norm?n NSQUARED2
Microsoft MVP, MCSD, MCAD, MCT

Cornerstone

My Blog, ASP.Net 2.0 etc
Dave Sussman
Asp.Net User
Re: Changing Themes programatically from Master Page3/2/2004 9:34:26 AM

0/0

It's also important to remember that the PreInit fires before any postback events, therefore you can't select your theme from a dropdown and have it applied in the same postback by referencing the dropdown in PreInit.

Fredrik mentions one method which is to use the client call-back feature, where you do an out-of-band callback to set the theme and then a proper postback. Another method is, in the PreInit, to pull the theme directly from the Form.

Dave
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 ASP.NET 2.0 Authors: Bill Evjen, Scott Hanselman, Farhan Muhammad, Srinivasa Sivakumar, Devin Rader, Pages: 1253, Published: 2005
Essential ASP.Net 2.0 Authors: Fritz Onion, Keith Brown, Pages: 345, Published: 2006
Beginning ASP.NET 3.5: In C# and VB Authors: Imar Spaanjaars, Pages: 734, Published: 2008
Professional ASP.NET 3.5: In C# and VB Authors: Bill Evjen, Scott Hanselman, Devin Rader, Pages: 1673, Published: 2008
Core Internet Application Development with ASP.NET 2.0 Authors: Randy Connolly, Pages: 1049, Published: 2007
Beginning ASP.NET 2.0 in VB 2005: From Novice to Professional Authors: Matthew MacDonald, Pages: 1063, Published: 2006
Beginning ASP.NET 3.5 in C# 2008: From Novice to Professional Authors: Matthew MacDonald, Pages: 954, Published: 2007
ASP.NET 2.0 Website Programming: Problem-design-solution Authors: Marco Bellinaso, Pages: 576, Published: 2006
Beginning ASP.NET 3.5 in VB 9.0: From Novice to Professional Authors: Matthew MacDonald, Pages: 1149, Published: 2007

Web:
Changing Themes programatically from Master Page - ASP.NET Forums Changing Themes programatically from Master Page. Last post 03-02-2004 5:46 AM by Dave Sussman. 2 replies. Sort Posts: ...
Programmatically switch CS theme for main page and blogs ... I would like to switch CS themes programatically depending on context. .... The following picture is observed: on site loaded master page ...
How to: Apply ASP.NET Themes Programmatically You can set both page themes and style sheet themes programmatically; however, ... You need to set the Master page then the controls are available. ...
How To? Programmatically Set Theme For Master Page Talk about How To? Programmatically Set Theme For Master Page. ... programmatically set a theme for a master page? ...
Switching Master Page CSS Theme Programmatically - ASP.NET Forums How do I switch a master page's CSS page programmatically during form ... in it and changing the theme will automatically load the CSS file. ...
Dynamic Themes and META Data using ASP.NET 2.0 Master Pages May 17, 2007 ... NET was first created: Themes and Master Pages. ... Finally, setting the Theme programmatically by setting the Theme property of the Page is ...
Adventures in C#: Loading themes programmatically Other pages (not the .master pages though) inherit this BasePage instead of System.Web.UI.Page. ... One can programmatically set the page theme (this.Page. ...
SharePoint customization - applying a theme programmatically ... Jun 24, 2008 ... Automating the masterpage install is easy -you create a feature and ... And there you go - you can programmatically apply a theme to a site. ...
K. Scott Allen : Setting An ASP.NET Theme in the PreInit Event Handler If the DropDownList is on a master page, the UniqueID might look like ... possible to change the APPLICATION'S theme programmatically via a user's input. ...
novolocus.com » Programmatically apply a Default Theme in SharePoint Oct 17, 2008 ... Programmatically apply a Default Theme in SharePoint ... I’ve written a brand that is a combination of Theme and Master Page, ...




Search This Site:










mouseover img button wont change asp.net textbox border color

could not access 'cdo.message' object.

printer friendly version

private messages for dotnetnuke 2.0

how can content page sub page_load read master page session state?

don't try to access controls in initializeculture()

delete a member from aspnet.mdf by a button in webpage

is there a way to show an external .htm page in a web part?

role-based profiles

using asp:login control... how to connect to my own database?

my changes will not save in the script task in ssis package in visual studio 2005

assigning host privileges

purging master page output?

formsauthentication.requiressl

composite control

htaccess

help please on parent or child portal

[:'(] is dotnetnuke compatible with mysql???

treeview control and xml

login control and returnurl

easy solpartmenu question

script injection

customise modules - dynamic views using module settings...

task list (new version)

assemblyinfo.cs

is there getusersbyrolename method anywhere in dnn3

mapquest.

new install 3.1 - all modules are "currently unavailable"

parser error "caused" by vwd2008

website vs web app project

 
All Times Are GMT