473,404 Members | 2,179 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,404 software developers and data experts.

problem with Request.ApplicationPath

Hi,

i use a masterpage in my application. When navigating to another site
without closing the browser and then coming back
to the application, the images and css styles are lost.

So i did this for the images:
<img src="<%=Request.ApplicationPath%>/images/01.gif" />
and this works.

Now my css file (green.css) is in App_Themes/green and i refer to it from
web.config like this:
<appSettings>
<add key="mytheme" value="green"/>
</appSettings>

I defined a class like this:
Public Class param
Public Shared ReadOnly Property mytheme() As String
Get
Return ConfigurationManager.AppSettings("mytheme").ToStri ng()
End Get
End Property

and finally this in code-behind:
Protected Sub Page_PreInit(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.PreInit
Page.Theme = param.mytheme
End Sub

But this doesn't work when a user comes back to the application without
closing the browser. I guess i have here also to
add Request.ApplicationPath, but where?
I tried in the class, in code-behind, in web.config without succes.

Thanks for help
Chris
Oct 16 '07 #1
0 1511

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

Similar topics

5
by: Vadym Stetsyak | last post by:
Hi, All! For example if I have http://server/myvirtualpath/someotherpath/page.asp and virtual path on the IIS is http://server/myvirtualpath How can I retrieve above mentioned asp...
0
by: Jim Corey | last post by:
I've seen this same sort of code (below) on other posts. This works fine for me on my development machine, but not when I move it to my hosted site. When I view the source from my machine, I...
2
by: martin | last post by:
Hi, I am developing a class to help my asp.net application along. The class is part of a seperate project although this project is included in the same solution as my main web application. I...
0
by: Kent P. Iler | last post by:
Hi, I used Request.ApplicationPath for referencing my images directory from multiple levels. It worked great in my dev environment. However, when I copied the project to my production server,...
2
by: ad | last post by:
I want to get the Application path, I use the code: string sDir = Request.ApplicationPath ; It run well in code behind, but if I place the code above in Global.asax like: void...
3
by: Griff | last post by:
I understand how to dynamically change the text of a label that appears in the body tag by using code in the "code behind" page - one adds a <asp:label id="labelToUpdate"/> tag. However, I need...
3
by: Mark Olbert | last post by:
I have some img tags on a master page which reference files in a top-level directory. They look like this: <img src="assets/test.gif" id="gnr" /> assets is a subdirectory of the website root. ...
0
by: Chris | last post by:
Hi, When navigating to another site without closing the browser and then coming back to the application, the images and css styles are lost. So i did this for the images: <img...
2
by: CKKwan | last post by:
Dear All, Using VS2008 on Vista (IIS7). Request.ApplicationPath return something like "http://localhost:50440/" When deploy into Server 2003 (IIS6), found that Request.ApplicationPath is...
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: 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
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.