problem with Request.ApplicationPath

C

Chris

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").ToString()
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,817
Latest member
DicWeils

Latest Threads

Top