472,331 Members | 1,604 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

ASP.NET/C# 2.0 - Getting the page's theme in a class

Ok, I am a nOOb C#/NET coder, so this is probably easy.. heh heh (only been
pecking is these languages for a week now, just converted from vbscript and
classic asp)

But anyways, I have a class library - and wish to be able to determine the
currently loaded theme for the calling webpage programaticly.. I can do this
in the code-behind using page.theme - but can not in the class library (for
whatever small reason I am missing)..

Hope I am explaining myself clearly :))

But again, I am complete utter nOOb right now.. took me an hour to figure
out how to use a response.write in the class library..
System.Web.HttpContext.Current.Response.Write("Hel lo World!");
LoL

Well Any Help is Appreciated,
-Norman
Jun 28 '07 #1
3 1868
"Norman Wooten @yahoo.com>" <wooten26<removethiswrote in message
news:hY******************************@comcast.com. ..
Ok, I am a nOOb C#/NET coder, so this is probably easy.. heh heh (only
been pecking is these languages for a week now, just converted from
vbscript and classic asp)

But anyways, I have a class library - and wish to be able to determine the
currently loaded theme for the calling webpage programaticly.. I can do
this in the code-behind using page.theme - but can not in the class
library (for whatever small reason I am missing)..

Hope I am explaining myself clearly :))
Why not just pass Page.Theme as a parameter to the method(s) in your class
which need it...?
--
http://www.markrae.net

Jun 28 '07 #2
On Jun 28, 2:40 pm, "Mark Rae" <m...@markNOSPAMrae.netwrote:
"Norman Wooten @yahoo.com>" <wooten26<removethiswrote in messagenews:hY******************************@comca st.com...
Ok, I am a nOOb C#/NET coder, so this is probably easy.. heh heh (only
been pecking is these languages for a week now, just converted from
vbscript and classic asp)
But anyways, I have a class library - and wish to be able to determine the
currently loaded theme for the calling webpage programaticly.. I can do
this in the code-behind using page.theme - but can not in the class
library (for whatever small reason I am missing)..
Hope I am explaining myself clearly :))

Why not just pass Page.Theme as a parameter to the method(s) in your class
which need it...?

--http://www.markrae.net
Hi...

take a look at this code

(System.Web.HttpContext.Current.Handler as System.Web.UI.Page).Theme;

you can access your theme any where :)

Thanks
Munna
http://munnacs.110mb.com/

Jun 28 '07 #3
Ok, finally figuered it out with your help! This what I came up with:

// Using Namespaces
using System.Web;
using System.Web.UI;

// Variable Declaration
private Page Testing = new Page();

// Casting
Testing = (Page)HttpContext.Current.Handler;

// Then Can Access Like
HttpContext.Current.Response.Write(Testing.Theme);

If there is more streamlined way to Declare/cast on one line or something..
lol.. but I am happy with result anyways :))
Hi...

take a look at this code

(System.Web.HttpContext.Current.Handler as System.Web.UI.Page).Theme;

you can access your theme any where :)

Thanks
Munna
http://munnacs.110mb.com/

Jun 28 '07 #4

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

Similar topics

1
by: Miguel Dias Moura | last post by:
Hello, I am creating a master page for a web site. All pages created from this master page will use the same theme. However I am not able to...
0
by: damiensawyer | last post by:
Hello all, I'm very new to all of this. I have a theme and a skin (the standard ones). I have a standard master page which is holding a custom...
3
by: dvan | last post by:
I've created a theme Css for my Asp.net 2.0 web application. The web.config Pages Theme key is set to the theme name. Everything seams to work fine...
1
by: Joey | last post by:
Hello, I have tried to programmatically set the theme for my master page by putting code in a "Page_PreInit" fuction in the master page's code...
3
by: Mr Flibble | last post by:
If I have a base page Default.aspx (and Default.aspx.cs). Can I have via ASP.Net inheritance another page derived from Default.aspx(and .cs) as...
7
by: GaryDean | last post by:
In my old 1.1 apps the default was MS_POSITIONING="GridLayout" and Textboxes and labels and such always had POSITION: absolute; and I never had any...
4
by: JJ | last post by:
My master page contains various graphics that are referenced from the images folder. As long as the container pages are at the same level (ie. the...
2
by: Marc | last post by:
I am studying a bit and I have encountered some reading stuff about skin files, css files and themes in asp.net. To me the name of the...
1
by: Sushmitha | last post by:
Please help me, this is really bugging since a week. I have a code that says: <DIV CLASS ="SLIDETABS"> <ul id="solutionstabs"...
0
by: tammygombez | last post by:
Hey fellow JavaFX developers, I'm currently working on a project that involves using a ComboBox in JavaFX, and I've run into a bit of an issue....
0
by: tammygombez | last post by:
Hey everyone! I've been researching gaming laptops lately, and I must say, they can get pretty expensive. However, I've come across some great...
0
by: concettolabs | last post by:
In today's business world, businesses are increasingly turning to PowerApps to develop custom business applications. PowerApps is a powerful tool...
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: CD Tom | last post by:
This happens in runtime 2013 and 2016. When a report is run and then closed a toolbar shows up and the only way to get it to go away is to right...
0
by: CD Tom | last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...

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.