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