"Mark Rae [MVP]" <(E-Mail Removed)> wrote in message
news:OAF8%(E-Mail Removed)...
> "_Who" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
>
> [please don't top-post]
>
>>>> I have an .htm file that shows in an iframe which is part of a master's
>>>> asp:Content.
>>>>
>>>> But I don't know how to extract from Session("StyleSheetIndex"); rather
>>>> than set it. And all the rest!
>>>>
>>>> Can this be done in JavaScript?
>>>
>>> No. JavaScript is client-side - it can't interrogate Session variables
>>> because Session is server-side...
>>
>> Isn't there a way around that.
>
> Not while you're using an HTML file. HTML files are not processed by
> ASP.NET - they are simply streamed to the client...
>
>> Maybe do save something additional when I save the session variable that
>> will be available on the client side.
>
> I don't know how else to explain this to you - JavaScript runs on the
> client. This means it can't interact with the server. Once a piece of
> JavaScript has been streamed down to the client browser, the server has no
> further control over it...
I understand the difference but I figured since the serrver side develops
the HTML it might be able to stuff some data someplace in the HTML. Like
your sugested a cookie. Now I'm familiar with the cookies on disk. But I
gather from your suggesstion below that I can create one on the server that
somehow becomes available on the client. (right?) I'll look into that.
>
> You could, perhaps, look at saving the Session variable as a cookie and
> then retrieving it with JavaScript:
> http://www.google.co.uk/search?sourc...aScript+cookie
>
>> What about the rest of the code. Is it possible to convert that to
>> JavaScript?
I meant, can the following be done using javascript? Seems to me that since
the file Backgroundwhite.css is on the server the answer is no it can not be
done in javascript - but I have little insight in this process and wanted to
check before I gave up trying.
Dim objCSS As HtmlLink = New HtmlLink()
objCSS.Attributes.Add("href", "App_Themes/Backgroundwhite.css")
objCSS.Attributes.Add("rel", "stylesheet")
objCSS.Attributes.Add("type", "text/css")
HeadMaster.Controls.Add(objCSS)
Thanks a lot
>
> Server-side code is server-side code and client-side code is client-side
> code... You cannot convert from one to the other, as they both run
> completely separately one from the other...
>
>
> --
> Mark Rae
> ASP.NET MVP
> http://www.markrae.net