Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. WHere to put JavaScrip in ASP.net

WHere to put JavaScrip in ASP.net

Scheduled Pinned Locked Moved ASP.NET
csharpjavascriptasp-nettoolstutorial
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    hmanhha
    wrote on last edited by
    #1

    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

    F 1 Reply Last reply
    0
    • H hmanhha

      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

      F Offline
      F Offline
      F ES Sitecore
      wrote on last edited by
      #2

      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.

      H 1 Reply Last reply
      0
      • F F ES Sitecore

        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.

        H Offline
        H Offline
        hmanhha
        wrote on last edited by
        #3

        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.

        F 1 Reply Last reply
        0
        • H hmanhha

          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.

          F Offline
          F Offline
          F ES Sitecore
          wrote on last edited by
          #4

          Put it at the bottom.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups