Monday, April 9, 2012

External Javascript use in asp.net page

Experience : I wanted use javascript written in .js file in my ASP.NET page(.aspx page). I used following line of statement in my page to access the javascript file.

     <script src="Scripts/SimpleJS.js" type="text/javascript"/>

But it did not worked for me! 
when I browsed my page, it showed blank page in browser! I did not understand why it is happening at first glance. After that I tried below line of code,then it worked like magic

     <script src="Scripts/SimpleJS.js" type="text/javascript"></script>

I experienced in ASP.NET 4.0, probably same applies to other versions as well.

Happy Coding :)

No comments:

Post a Comment