Abount separate java script code with asp.net.

J

Jeff

Hi,

Are there anyone can help me? My questions are as following:
Because I have a tools bar which coding with javascript, it will reuse
very often. So I want to separate the client-side java script code
with asp.net .
And make the client-side java script code as user defined cotrol.
But I only find the RegisterClientScriptBlock method, it only can
insert java script code to <body></body> in html.
But my java script code must insert between <head> and </head> in
html.

Are there any solution can separate java script code with asp.net and
reached to my request?

Thanks,

Jeff
 
J

Janaka

Jeff,

I'd just try putting all your javascript code into a sinlge .js file and
then reference this where needed in the <head> section of the aspx file like
the following: <head><script language="javascript"
src="common.js"></script></head>
 
J

Janaka

Sorry I don't see why this needs to be in a usercontrol, unless the control
is dynamically generating the javascript?
 
J

Jeff

Hi,

Because I will reuse this javascript very often. For example, the
treeview or menu functions in all page. Those functions were make by
java script with GUI.

Jeff
 

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

Top