By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,703 Members | 1,116 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,703 IT Pros & Developers. It's quick & easy.

Strange Window.Open problem

P: n/a
I have inherited an intranet ASP.NET (C#) page running on
Windows 2000.

The page populates a label control with some javascript
to open a pop-up to a document (xls, doc, pdf, etc.).
This is what is output onto the page:

<span id="javascriptLabel">
<script language="javascript">
<!--
window.open("./SomeFolder/SomeDocument.doc");
//-->
</script>
</span>

If the user has javascript turned off there is also a
link provided.

Here's the problem:

The window.open has begun not allowing the document to
open. The File Download diaglogue initially appears then
the message "Cannot open {pathnamehere}." appears. The
odd thing is ... if you click the standard direct link it
opens no problem.

Another odd thing is when you open a brand new window and
type in the address manually it gives the same "Cannot
open" error.

I initially thought someone had mucked with permissions
but then why would it allow them to access it via direct
link.
Nov 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hi Melissa,

have you tried this ?
window.open("~/PathToSomeFolder/SomeFolder/SomeDocument.doc"); this will open the document at the current directory structure in your
virtual root.

http://localhost/MyVirtualDir/PathTo...meDocument.doc

HTH
Regards
Ashish M Bhonkiya

"Melissa" <an*******@discussions.microsoft.com> wrote in message
news:e3****************************@phx.gbl... I have inherited an intranet ASP.NET (C#) page running on
Windows 2000.

The page populates a label control with some javascript
to open a pop-up to a document (xls, doc, pdf, etc.).
This is what is output onto the page:

<span id="javascriptLabel">
<script language="javascript">
<!--
window.open("./SomeFolder/SomeDocument.doc");
//-->
</script>
</span>

If the user has javascript turned off there is also a
link provided.

Here's the problem:

The window.open has begun not allowing the document to
open. The File Download diaglogue initially appears then
the message "Cannot open {pathnamehere}." appears. The
odd thing is ... if you click the standard direct link it
opens no problem.

Another odd thing is when you open a brand new window and
type in the address manually it gives the same "Cannot
open" error.

I initially thought someone had mucked with permissions
but then why would it allow them to access it via direct
link.

Nov 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.