Click here to Skip to main content
15,886,095 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello Sir,

I want to Multiple Aspx Page Validate in Single JavaScript Code.

I write a JavaScript for a Single Page But this JavaScript code Use for All Pages.

How Can Possible and how to Add one JavaScript to All Pages.


Thanks
Ashish Jaiswal
Posted

How Can Possible and how to Add one JavaScript to All Pages.
1. Make sure your JavaScript methods are generic enough to handle any page call.
2. Put all the JavaScript into a *.js file instead in webpage
3. Refer the above JavaScript file in all the web pages needed. You would need to add the script tag in webpage <HEAD> tag:
HTML
<script type="text/javascript" src="Scripts/Utilities.js"></script>
 
Share this answer
 
Just call that java script page on your aspx page.

and in javascript page create common function with control & message for every type validation then use that Just try it.
 
Share this answer
 
You need to add javascript reference to your master page. Actually all pages use Masterpage. If any page not use master page then you individually add that script file reference to that page. Then from all pages, you can call that javascript method.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900