G
Guest
Hi,
I have a usercontrol which includes a small piece of Javascript built up
as a string in <script> tags and put onto a web page when an instance of the
User Control is created. The Javascript does some client side checking of
User Input.
If I use multiple instances of the same user control on a page, the same
block of Javascript is repeatedly written to the page (once for each instance
of the user control). Although the user controls still work, it creates a
bigger page to download from the server.
Is ther any way of just writing the Javascript the once to the page? or is
there a better way of getting the Javascript written. (I wanted to keep the
Javascript integral to the user control so that it was independent).
Many thanks,
Pete
I have a usercontrol which includes a small piece of Javascript built up
as a string in <script> tags and put onto a web page when an instance of the
User Control is created. The Javascript does some client side checking of
User Input.
If I use multiple instances of the same user control on a page, the same
block of Javascript is repeatedly written to the page (once for each instance
of the user control). Although the user controls still work, it creates a
bigger page to download from the server.
Is ther any way of just writing the Javascript the once to the page? or is
there a better way of getting the Javascript written. (I wanted to keep the
Javascript integral to the user control so that it was independent).
Many thanks,
Pete