I'm trying to open a document from my machine to the browser. This is my code:
string script = string.Format("window.open(\"file:{0}\", \"_blank\");", tempSubFolderPath.Replace(@"\", @"/"));
ScriptManager.RegisterClientScriptBlock(UpdatePanel1, UpdatePanel1.GetType(), "OpenDoc", script, true);
When I debug it, this is what I get for the script:
window.open("file://MyMachineName/Temp/hw4ynub4.zsx", "_blank");
I even tried by providing the path with the document name like this:
string script = string.Format("window.open(\"file:{0}\", \"_blank\");", TempDocPath.Replace(@"\", @"/"));
and this is when I debug what I get for the script:
window.open("file://MyMachineName/Temp/qmr2qodz.tfb/20180221_182350.doc", "_blank");
It didn't work with both options. The page opens as a blank page. The document exists in my machine and I can access to it but I can't open it in a new window in the browser. Please advise. Thanks!