473,386 Members | 1,962 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

User-Specified Themes

If I want each user to be able to specify their own themes, does that mean I
must set the theme in an even handler (such as PreInit) for every single
page?

I suppose I could cache the user's theme in the Session object. But I
wondered if there was any shortcut to having to set the theme in the PreInit
event for every single page.

Thanks.

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com

Dec 18 '07 #1
6 1158
Hello Jonathan,

yes u must

see there http://quickstarts.asp.net/QuickStar...alization.aspx

---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo
JWIf I want each user to be able to specify their own themes, does
JWthat mean I must set the theme in an even handler (such as PreInit)
JWfor every single page?
JW>
JWI suppose I could cache the user's theme in the Session object. But
JWI wondered if there was any shortcut to having to set the theme in
JWthe PreInit event for every single page.
JW>
JWThanks.
JW>
Dec 18 '07 #2
Thanks!

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com

"Michael Nemtsev [MVP]" <ne*****@msn.comwrote in message
news:3d**************************@msnews.microsoft .com...
Hello Jonathan,

yes u must

see there
http://quickstarts.asp.net/QuickStar...alization.aspx

---
WBR, Michael Nemtsev [.NET/C# MVP] :: blog:
http://spaces.live.com/laflour
"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo

JWIf I want each user to be able to specify their own themes, does
JWthat mean I must set the theme in an even handler (such as PreInit)
JWfor every single page?
JWJWI suppose I could cache the user's theme in the Session object.
But
JWI wondered if there was any shortcut to having to set the theme in
JWthe PreInit event for every single page.
JWJWThanks.
JW>
Dec 18 '07 #3
But I wondered if there was any shortcut to having to set the theme in the
PreInit event for every single page.
You can set the theme in Application_PreRequestHandlerExecute in
global.asax:

private void Application_PreRequestHandlerExecute(Object sender, EventArgs
e)
{
HttpContext CurrentContext = HttpContext.Current;
Page p = ( CurrentContext.Handler as Page );
if ( null != p )
{
p.Theme = "Default";
}
}
}

Dec 18 '07 #4
That's cool if that will work.

One thing: my plan is to cache the user's theme in the Session object. So
this code will need to be able to access both the Session object and some
database code. I assume the database code will work but now I wonder if the
Session object will be available. I would also need to get info for the
current user, which may not be set up either.

I'll have to play around with that.

Thanks.

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com

"Scott Roberts" <sr******@no.spam.here-webworks-software.comwrote in
message news:u3**************@TK2MSFTNGP04.phx.gbl...
>But I wondered if there was any shortcut to having to set the theme in
the PreInit event for every single page.

You can set the theme in Application_PreRequestHandlerExecute in
global.asax:

private void Application_PreRequestHandlerExecute(Object sender, EventArgs
e)
{
HttpContext CurrentContext = HttpContext.Current;
Page p = ( CurrentContext.Handler as Page );
if ( null != p )
{
p.Theme = "Default";
}
}
}
Dec 18 '07 #5
The Session and User are both populated and available on the CurrentContext.

"Jonathan Wood" <jw***@softcircuits.comwrote in message
news:OR**************@TK2MSFTNGP03.phx.gbl...
That's cool if that will work.

One thing: my plan is to cache the user's theme in the Session object. So
this code will need to be able to access both the Session object and some
database code. I assume the database code will work but now I wonder if
the Session object will be available. I would also need to get info for
the current user, which may not be set up either.

I'll have to play around with that.

Thanks.

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com

"Scott Roberts" <sr******@no.spam.here-webworks-software.comwrote in
message news:u3**************@TK2MSFTNGP04.phx.gbl...
>>But I wondered if there was any shortcut to having to set the theme in
the PreInit event for every single page.

You can set the theme in Application_PreRequestHandlerExecute in
global.asax:

private void Application_PreRequestHandlerExecute(Object sender,
EventArgs e)
{
HttpContext CurrentContext = HttpContext.Current;
Page p = ( CurrentContext.Handler as Page );
if ( null != p )
{
p.Theme = "Default";
}
}
}
Dec 18 '07 #6
Cool. Thanks!

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com

"Scott Roberts" <sr******@no.spam.here-webworks-software.comwrote in
message news:%2****************@TK2MSFTNGP02.phx.gbl...
The Session and User are both populated and available on the
CurrentContext.

"Jonathan Wood" <jw***@softcircuits.comwrote in message
news:OR**************@TK2MSFTNGP03.phx.gbl...
>That's cool if that will work.

One thing: my plan is to cache the user's theme in the Session object. So
this code will need to be able to access both the Session object and some
database code. I assume the database code will work but now I wonder if
the Session object will be available. I would also need to get info for
the current user, which may not be set up either.

I'll have to play around with that.

Thanks.

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com

"Scott Roberts" <sr******@no.spam.here-webworks-software.comwrote in
message news:u3**************@TK2MSFTNGP04.phx.gbl...
>>>But I wondered if there was any shortcut to having to set the theme in
the PreInit event for every single page.

You can set the theme in Application_PreRequestHandlerExecute in
global.asax:

private void Application_PreRequestHandlerExecute(Object sender,
EventArgs e)
{
HttpContext CurrentContext = HttpContext.Current;
Page p = ( CurrentContext.Handler as Page );
if ( null != p )
{
p.Theme = "Default";
}
}
}
Dec 18 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

60
by: Fotios | last post by:
Hi guys, I have put together a flexible client-side user agent detector (written in js). I thought that some of you may find it useful. Code is here: http://fotios.cc/software/ua_detect.htm ...
3
by: zlst | last post by:
Many technological innovations rely upon User Interface Design to elevate their technical complexity to a usable product. Technology alone may not win user acceptance and subsequent marketability....
6
by: martin | last post by:
Hi, I am a web page and a web user control. My web user control is placed in my web page using the following directive <%@ Register TagPrefix="uc1" TagName="Header"...
1
by: Shourie | last post by:
I've noticed that none of the child controls events are firing for the first time from the dynamic user control. Here is the event cycle. 1) MainPage_load 2) User control1_Load user clicks a...
7
by: jsale | last post by:
I'm currently using ASP.NET with VS2003 and SQL Server 2003. The ASP.NET app i have made is running on IIS v6 and consists of a number of pages that allow the user to read information from the...
0
by: tony | last post by:
Hello! This is a rather long mail but it's a very interesting one. I hope you read it. I have tried several times to get an answer to this mail but I have not get any answer saying something...
2
by: rn5a | last post by:
Assume that a user control (MyUC.ascx) encapsulates 2 TextBoxes with the IDs 'txt1' & 'txt2' respectively. To use this user control in an ASPX page, the following Register directive will be...
1
by: Carlettus | last post by:
Dear All, sorry but I'm not sure if this is the right place to post my problem. I was using the following asp code to create users in Active Directory. Suddenly, and I don't know the reason, users...
9
by: Gordon | last post by:
I want to add a feature to a project I'm working on where i have multiple users set up on my Postgres database with varying levels of access. At the bare minimum there will be a login user who...
3
by: shapper | last post by:
Hello, On my web site I have a property, Visitor, which is available for Anonymous users: public class Visitor { public CultureInfo Culture { get; set; } public List<GuidPolls { get; set;...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.