Web Forms :: Global File Not Changing Theme For Urlrewritten Url's?
Feb 16, 2011
I'm setting my site theme with the following code in my global.asax file, but if I go to a product page with a URL that has been rewritten through a rewriter, the global file doesn't affect the master page anymore and the page doesn't use the theme that is being set in the global file?
I am now in process doing theme for my web application.
This is how i want my Theme work :Whenever user choose to change the theme, the whole web site theme should changed accrodingly.
Most of the examples that i find out online require to assign the theme in Page_PreInit event in every page. The theme name is store in session variable.
My concern is that is there anyway to assign particular theme to whole web site without having assing it to every page and store the theme into session variable.
I have provided 2 theme in home page (default.aspx) , onclick of this link i am able to change the css path and image path according to the theme selected but once i login the image path are comming correctly accordinly to theme selected but the css (stylesheet) path is not changing.
when i select a theme and view the source of default page all the paths are changing but once loged css path is not changing.
I'm wanting to adjust this code to pull the theme name from a database table, instead of just manually assigning a theme in the file. This way a site administrator can set the theme dynamically. If never done this with a global.asax file, so I'm not sure what the best way is to accomplish it?
Here's the code that needs tweaked:
[Code]....
The database table could be "ThemeName" with rows ID & Theme. If performing this in the global.asax file will cause any big performance issues.
I have an asp.net application. I want to add a global.asax and global.asax.cs file to my project. In the IDE when I select to create a new global.asax file, the option to create a CS code behind file is greyed out. When the global.asax file is created, no code behind is created, instead code is placed in the global.asax file and the global.asax.cs file is never created? Why is the option for a C# code behind file greyed out?
When I right click on any folder below the App_Themes folder in VS 2010, the only web file that appears to be able to be added is the Skin file. If I pick a regular folder within the site (other than App_Themes), Style Sheet does appear.
I checked both an existing web application project (VS2008 upgraded to VS2010) and a new web application project created in VS2010 and both yield the same results.
I can create a CSS file in another folder (like the main folder) and then drag it into the theme folder, as a work around. Just trying to determine if I was missing something regarding theme folder and CSS files.
We have a legacy app with multiple asp.net themes. Each theme have a .skin file. Each skin file is almost identical except for some things. The files share a lot of similarities. Is it possible to share a common .skin file across themes?
I just added a global file to my web application and now I am getting this message.
Error 3 'global_asax' is ambiguous in the namespace 'ASP'. C:WINDOWSMicrosoft.NETFrameworkv2.0.50727Temporary ASP.NET FilesmyFile759a71c4f17a867App_global.asax.sfac6plp.1.vb 31
Is there anyway i can mention which CSS file should be attached to my Page automatically when running A Page with ASP.NET Themes /Skins ? I want to associate my own CSS which resides in a folder other than the APP_Themes Folder to the Page
I want to access the static variable in my global.ashx file I am using classname.variable name for accessing the variable but the variable name dose not appear.Can someone tell me how to access static varialbe in *.ashx file.
I am have declared a session variable in login page of my application. I want to access that session variable in Application_BeginRequest of global.asax file. But I am not able to do it. Could you please suggest how to access the session variable in my global.asax file
I have a code behind file which has only a few placeholders and literal. The gridview control and others are added in real time according to program conditions. I noticed that once in a while th eprogram stopped working because the .aspx file is changed and some of the place holders disappeared - Why? (the bolded lines disappeared once in a while)
I've got a script below that uploads multiple files and works fine. I am trying to rename them as I upload them and I'm having some trouble figuring it out.
When debugging my application, I m getting an application level error in global.asax file. The Server.GetLastError() reads "File does not exist." but thats it. No more details on the filename or the location where the code is trying to find a file. I commented out the application_error method, with a hope that the exception would be thrown when the debug the application, but no errors were thrown. How do i find the source of the error, cos I want to resolve this issue by either putting the file that the application is looking for or by completely removing the code that is referencing the file.
I have a XSD file in my website. I need to give its path in code.
using (XmlTextReader textReader = new XmlTextReader (@"C:VS2008ProjectsInterfaceSchema.xsd"))
But, If my website move to dev server, QA server, Prod server, I need to change the path here. Can we do any other way instaed of whole path. Like example for css file, we just name of <link href="filen.css">.
I tried to replace the path with "/Schema.xsd" but getting exception file not found. I tried eith ~ root symbol also. No use.
I also can do by keeping the value in webconfig. Even though, i need to change it every time.
we have a store that we contracted with a company to modify. They added the following to our Global.asax file:
[code]...
The purpose is to take anyone going to one of our pages to a login screen unless they are going to these folders which do not need the login protection.