|
I have the same javascript functions which will be used by different ASP.NET web applications, so instead writing the same scripts to every .aspx file, I should make it shared. but how can I do that? save the scripts into a file and then called by different .aspx files? If so, what will be the syntax? I know this question may be too simple, however, I haven't done this before, so really appreciate if you could show me how to do it, thank u!!
|
|
|
Yes, put your javascript into an external file, with a "/forum/.js" extension. The file contains just the javascript (you don't the <SCRIPT></SCRIPT> tags).
Then, to reference them in an HTML (or ASPX) file, you use:
<script type="text/javascript" src="/forum/myExternalJavascript.js" />
Simple as that!
|
|
|
|
|
hi there? if I wrote script type="text/javascript" src="/forum/myExternalJavascript.js" />
, the page won't be rendered at all. I have to write
<script type="text/javascript" src="/forum/myExternalJavascript.js"></script>
Aren't they the same definition? ...
|
|
|
Yes, they are:
<script />
Is functionally the same as:
<script></script>
But use what works. Perhaps your doctype requires an explicit closing tag.
|
|
|
|
|
Thanks for your information.
I am trying to develop amother windows application allowing user to control windows services. I have an ArrayList containing windows services data to be displayed to the user. Except displaying the Service Name and status, I would like to have a column of check box and maybe a column of buttons associated with each row.
I am not sure whether to use Listview or datagrid? so little comparison information between these two in the net. it seems none of them support column of button control? I feel even if the check box is not easy to implement, how do you feel?
Thank u very much!!
|
|
|
DataGrid is much more powerful and complex, and is overkill in most situations. ListView sounds right for your case.
Have you looked at the Repeater control?
|
|
|
|
|
It seems windows application doesn't provide us a Repeater control. If I am not wrong, Repeator is only in web application.
|
|
|
We're in the ASP.NET forum, and we're talking about JavaScript. I assumed you were developing a web application.
|
|
|
|
|
you are right, just feel more experts in ASP.NET forum. :):) and I believe those of you are not only good at web app development but windows app development. So also raised my questions here....
|
|
|
I haven't done any windows development with .NET, sorry!
|
|
|
|
|