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

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,007
Latest member
obedient dusk

Latest Threads

Top