"Out of chaos comes order."
Nietzsche
"Yama" <> wrote in message
news:...
> Hi,
>
> How can I dynamically embed the content of a filename.js into a .aspx
> page before rendering it to the client?
>
> Thanks,
>
> ~yamazed
>

First I detect the browser and what type of scripting I'll use. I compile
each IE6javascript.js (and all others) into the project as an embedded
resource (select the script's property and change the "Build Action" from
"Content to Embedded Resource) then in my code:

Finally perform a cache on server and client side. If the server code
changes then force the change in the client machine.Hint: I use the Observer
design pattern along with the factory method design pattern to achieve all
of this.

There may be one other way that I have been trying. I have made some
modifications to the code that I published on CodeProject, but I have not
re-submitted it yet. I basically substituted the HttpModule with an
HttpHandler instead. The Handler then can recall the custom data from
server memory without having to re-load it on each postback. The event
handlers are stored in session state, so they do not have to be destroyed on
each postback as it is done on the current implementation. So far I have
only done it on the CustomImage controls, but I don't see why it couldn't be
done on the JavaScript custom handler as well. If you want the source I can
send it to you.

Share This Page

Welcome to The Coding Forums!

Welcome to the Coding Forums, the place to chat about anything related to programming and coding languages.

Please join our friendly community by clicking the button below - it only takes a few seconds and is totally free. You'll be able to ask questions about coding or chat with the community and help others.
Sign up now!