Strange Window.Open problem

Discussion in 'ASP .Net' started by Melissa, May 17, 2004.

  1. Melissa

    Melissa Guest

    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.
     
    Melissa, May 17, 2004
    #1
    1. Advertising

  2. 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/PathToSomeFolder/SomeFolder/SomeDocument.doc

    HTH
    Regards
    Ashish M Bhonkiya

    "Melissa" <> wrote in message
    news:e3a401c43c37$b70cbe30$...
    > 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.
     
    Ashish M Bhonkiya, May 18, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. ml
    Replies:
    0
    Views:
    1,467
  2. ml
    Replies:
    2
    Views:
    4,877
    John C. Bollinger
    Nov 30, 2004
  3. wax
    Replies:
    9
    Views:
    353
  4. raj
    Replies:
    0
    Views:
    202
  5. PC HUA
    Replies:
    2
    Views:
    440
    PC HUA
    May 19, 2004
Loading...

Share This Page