Javascript
-
http://www.codeproject.com/script/Forums/View.aspx?fid=1640&msg=2941077[^] Sorry if I'm making a repost. but I've been waiting for 2 days, and I tried posting the same question few months ago. I'm not able to find an answer for it. I left my efforts to find the answer & I'm taking the issue again. It's a simple one. Can someone look into it please?
:beer:
-
http://www.codeproject.com/script/Forums/View.aspx?fid=1640&msg=2941077[^] Sorry if I'm making a repost. but I've been waiting for 2 days, and I tried posting the same question few months ago. I'm not able to find an answer for it. I left my efforts to find the answer & I'm taking the issue again. It's a simple one. Can someone look into it please?
:beer:
The problem is that JavaScript doesn't know (nor does it care) what the root of your application is. Something you can do is, in your script code, add a server-side expression that represents your application root, and assign it to a variable. From there, you can concatenate your relative path values.
var applicationRoot = "<%= System.Web.HttpContext.Current.Request.ApplicationPath %>";
document.open(applicationRoot + "/myFolder/myDoc.htm");
-
The problem is that JavaScript doesn't know (nor does it care) what the root of your application is. Something you can do is, in your script code, add a server-side expression that represents your application root, and assign it to a variable. From there, you can concatenate your relative path values.
var applicationRoot = "<%= System.Web.HttpContext.Current.Request.ApplicationPath %>";
document.open(applicationRoot + "/myFolder/myDoc.htm");