codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  How to share same javascript functions among different ASP.NET web pages?  ipsoftware at 14:55 on Sunday, January 16, 2005
 

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!!

  Re: How to share same javascript functions among different ASP.NET web pages?  tgreer at 04:06 on Monday, January 17, 2005
 

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!


  Re: How to share same javascript functions among different ASP.NET web pages?  ipsoftware at 07:58 on Tuesday, January 18, 2005
 

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? ...

  Re: How to share same javascript functions among different ASP.NET web pages?  tgreer at 14:21 on Tuesday, January 18, 2005
 

Yes, they are:

<script />

Is functionally the same as:

<script></script>


But use what works. Perhaps your doctype requires an explicit closing tag.



  Re: How to share same javascript functions among different ASP.NET web pages?  ipsoftware at 14:26 on Tuesday, January 18, 2005
 

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!!

  Re: How to share same javascript functions among different ASP.NET web pages?  tgreer at 15:40 on Tuesday, January 18, 2005
 

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?


  Re: How to share same javascript functions among different ASP.NET web pages?  ipsoftware at 15:50 on Tuesday, January 18, 2005
 

It seems windows application doesn't provide us a Repeater control. If I am not wrong, Repeator is only in web application.

  Re: How to share same javascript functions among different ASP.NET web pages?  tgreer at 16:36 on Tuesday, January 18, 2005
 

We're in the ASP.NET forum, and we're talking about JavaScript. I assumed you were developing a web application.



  Re: How to share same javascript functions among different ASP.NET web pages?  ipsoftware at 16:43 on Tuesday, January 18, 2005
 

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....



  Re: How to share same javascript functions among different ASP.NET web pages?  tgreer at 17:49 on Tuesday, January 18, 2005
 

I haven't done any windows development with .NET, sorry!









CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  matrix addition
•  Re: Storing data from HTML to Excel or TXT
•  Re: function within loop problem
•  Re: Ô‡´ò¥¯¥é¥Ö¤à ¥Æ©`¥é©`¥á¥¤¥É£ò£±£±¥¢¥¤¥¢¥ó ¤Î£··¬ ¤Ç¤¹
•  Re: Replace
•  Re: タイトリスト AP2アイアン 712ã�®æƒ…å �
•  Re: SMS from Perl using HTTP request
•  Re: Charl Schwartzel
•  Re: Adhyayan - Annual Student Conference and Online Coding Festival


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2013