WHere to put JavaScrip in ASP.net
-
Hi all.IN many example i download here they use javascript. If I creat a page without masterpage.I know where to put this Javascript.But if I use Masterpage.WHere to put these script. Thanks
Do you mean js on the page? Or in a separate file? If it's in a separate file then put it in a "scripts" folder and refer to it like this
<script src="<%=Page.ResolveUrl("~/scripts/file.js") %>"></script>
If you're referring to js put on the page, then if the js uses elements on the master page put it on the master page, if it references elements on the content page put it on the content page, if it references both then put it on the content page also.
-
Do you mean js on the page? Or in a separate file? If it's in a separate file then put it in a "scripts" folder and refer to it like this
<script src="<%=Page.ResolveUrl("~/scripts/file.js") %>"></script>
If you're referring to js put on the page, then if the js uses elements on the master page put it on the master page, if it references elements on the content page put it on the content page, if it references both then put it on the content page also.
-
I Mean JS on the page, not in a separate file. The js is only use in Content Page.I Know I have to put it on the content page.But I don't know where to put it. I am a beginner.
Put it at the bottom.