473,395 Members | 1,584 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,395 software developers and data experts.

how to use Request.ApplicationPath?

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 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 17 '07 #1
0 1413

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...
1
by: Ponnurangam | last post by:
Hi, I have completed a website using Request.ApplicatioPath in a lot of places. eg.: (<img src='<%= Request.ApplicationPath %>/Images/logo.gif' />) It works locally, but doesn't work thru...
5
by: Miljana | last post by:
Hi, I have one problem with cookies in ASP.NET application. It seems that I can not retreive cookie from Request.Cookies collection. I put cookie in Response.Cookies collection, and after page...
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...
0
by: Chris | last post by:
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...
5
by: Rory Becker | last post by:
I have had code in my Application_Start which is intended to run once at the start of my application's life. It loads connection information and similar from a known location. However I...
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: 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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...

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.