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. format of path in window.open()

format of path in window.open()

Scheduled Pinned Locked Moved ASP.NET
questionjavascript
2 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.
  • P Offline
    P Offline
    ptvce
    wrote on last edited by
    #1

    i use this code in my form: cell8.Controls.Add(new LiteralControl("<A HREF=" + "javascript:window.open('a.htm')" + " <span style=" + "font-size:9pt;" + "></span>Print</A>")); where should be my page a.htm my mean is what is the path format. what should i write in window.open(????), my page a.htm is in this path : C:\webpart\WritingWebPart\Reservation

    L 1 Reply Last reply
    0
    • P ptvce

      i use this code in my form: cell8.Controls.Add(new LiteralControl("<A HREF=" + "javascript:window.open('a.htm')" + " <span style=" + "font-size:9pt;" + "></span>Print</A>")); where should be my page a.htm my mean is what is the path format. what should i write in window.open(????), my page a.htm is in this path : C:\webpart\WritingWebPart\Reservation

      L Offline
      L Offline
      l0kke
      wrote on last edited by
      #2

      You can't use physical path, unless you want to use your web application only for yourself on your local computer. (Other users probably don't have the file on the same physical path) If you have the a.htm file in the same folder as the file that contains the code above, then use just window.open('a.htm') if not, then you still can use relative path, for example window.open('SubFolder/a.htm') or window.open('../a.htm') THIS IS PREFERED WAY! or if you know what is going to be the url of the a.htm, then use it: window.open('www.myserver.com/myApp/a.htm') Note that url shouldn't be hardcoded, but should be determined in runtime (as zour application might be deplozed on more than one server, or the server name can be changed) Pilo

      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