open in new window

Discussion in 'ASP General' started by Andre, Mar 20, 2006.

  1. Andre

    Andre Guest

    First of all, I'm a rookie web developer, so please go easy. :)

    I have an .Net project that has an ASP page, that has links. When a user clicks on one of the hyperlinks, it opens an Excel page, in IE. One of the cells in the Excel Workbook contains a link to a PDF document. If the user clicks on the PDF link, it's opened in the current page. I'd like to know if it's possible to open the PDF in a new page. So it would basically be opening a PDF from the Excel document - that is opened in IE. My code to display the PDF hyperlink is in the last AddTableCellToTableRow line below:
    While sqlDR.Read()

    tblRow = New HtmlTableRow()

    tblRow.Align = "Left"

    AddTableCellToTableRow(tblRow, IIf(Not IsDBNull(sqlDR("Item Number")), sqlDR("Item Number"), ""))

    AddTableCellToTableRow(tblRow, IIf(Not IsDBNull(sqlDR("Item Description")), sqlDR("Item Description"), ""))

    AddTableCellToTableRow(tblRow, IIf(Not IsDBNull(sqlDR("Unit")), sqlDR("Unit"), ""), True)

    AddTableCellToTableRow(tblRow, IIf(Not IsDBNull(sqlDR("QTY")), sqlDR("QTY"), ""))

    AddTableCellToTableRow(tblRow, IIf(Not IsDBNull(sqlDR("Location")), "<a href=" + sqlDR("Location") + ">" + "Click here for PDF" + "</a>", ""))

    tblOrderGuides.Rows.Add(tblRow)

    End While



    Is it possible to modify the line to open the PDF in its own window?

    Thanks in advance!

    Andre
    Andre, Mar 20, 2006
    #1
    1. Advertising

  2. Andre

    Mike Brind Guest

    Andre wrote:
    > First of all, I'm a rookie web developer, so please go easy. :)
    >
    > I have an .Net project that has an ASP page, that has links. When a user clicks on one of the hyperlinks, it opens an Excel page, in IE. One of the cells in the Excel Workbook contains a link to a PDF document. If the user clicks on the PDF link, it's opened in the current page. I'd like to know if it's possible to open the PDF in a new page. So it would basically be opening a PDF from the Excel document - that is opened in IE. My code to display the PDF hyperlink is in the last AddTableCellToTableRow line below:
    > While sqlDR.Read()
    >
    > tblRow = New HtmlTableRow()
    >
    > tblRow.Align = "Left"
    >
    > AddTableCellToTableRow(tblRow, IIf(Not IsDBNull(sqlDR("Item Number")), sqlDR("Item Number"), ""))
    >
    > AddTableCellToTableRow(tblRow, IIf(Not IsDBNull(sqlDR("Item Description")), sqlDR("Item Description"), ""))
    >
    > AddTableCellToTableRow(tblRow, IIf(Not IsDBNull(sqlDR("Unit")), sqlDR("Unit"), ""), True)
    >
    > AddTableCellToTableRow(tblRow, IIf(Not IsDBNull(sqlDR("QTY")), sqlDR("QTY"), ""))
    >
    > AddTableCellToTableRow(tblRow, IIf(Not IsDBNull(sqlDR("Location")), "<a href=" + sqlDR("Location") + ">" + "Click here for PDF" + "</a>", ""))
    >
    > tblOrderGuides.Rows.Add(tblRow)
    >
    > End While
    >
    >
    >
    > Is it possible to modify the line to open the PDF in its own window?
    >
    > Thanks in advance!
    >
    > Andre


    This newsgroup is for classic asp. Dotnet is a different technology,
    and has its own newgroup. However, your question has nothing to do
    with either - it's a basic html question, and should have been posted
    to an html authoring group. Also, it should have been posted as plain
    text, not html.

    Change the last line of your code to

    AddTableCellToTableRow(tblRow, IIf(Not IsDBNull(sqlDR("Location")), "<a
    href=" + sqlDR("Location") + " target='_blank'>" + "Click here for PDF"
    + "</a>", ""))

    to get the link to open in a new window.

    --
    Mike Brind
    Mike Brind, Mar 20, 2006
    #2
    1. Advertising

  3. Andre

    Andre Guest

    Mike,

    Thanks for all the tips - sorry about posting in the wrong group. I tried
    your suggestion and it still opens in the same IE Excel window. The
    behavior is the same as it was before. Could this be because it's opening
    in Excel?

    Thanks, Andre


    > Change the last line of your code to
    >
    > AddTableCellToTableRow(tblRow, IIf(Not IsDBNull(sqlDR("Location")), "<a
    > href=" + sqlDR("Location") + " target='_blank'>" + "Click here for PDF"
    > + "</a>", ""))
    >
    > to get the link to open in a new window.
    >
    > --
    > Mike Brind
    >
    Andre, Mar 20, 2006
    #3
  4. Andre

    Mike Brind Guest

    Andre wrote:

    >
    >
    > > Change the last line of your code to
    > >
    > > AddTableCellToTableRow(tblRow, IIf(Not IsDBNull(sqlDR("Location")), "<a
    > > href=" + sqlDR("Location") + " target='_blank'>" + "Click here for PDF"
    > > + "</a>", ""))
    > >
    > > to get the link to open in a new window.
    > >


    > Mike,
    >
    > Thanks for all the tips - sorry about posting in the wrong group. I tried
    > your suggestion and it still opens in the same IE Excel window. The
    > behavior is the same as it was before. Could this be because it's opening
    > in Excel?
    >
    > Thanks, Andre


    I've got no idea. Someone in another group (html, excel) might know,
    though.

    --
    Mike Brind
    Mike Brind, Mar 21, 2006
    #4
    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. Cheryl
    Replies:
    2
    Views:
    18,032
    Cheryl
    Nov 12, 2003
  2. Gordon
    Replies:
    3
    Views:
    286
    Steven Burn
    Apr 16, 2004
  3. PC HUA
    Replies:
    2
    Views:
    390
    PC HUA
    May 19, 2004
  4. Berlin  Brown

    Selection; open popup or open a new window

    Berlin Brown, Jun 26, 2006, in forum: Javascript
    Replies:
    0
    Views:
    108
    Berlin Brown
    Jun 26, 2006
  5. Replies:
    1
    Views:
    223
Loading...

Share This Page