IIS ASP - open in new window

This is Interesting: Free IT Magazines  
Home > Archive > IIS ASP > March 2006 > open in new window





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author open in new window
Andre

2006-03-21, 3:16 am

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

Mike Brind

2006-03-21, 3:16 am


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 AddTableCellToTabl
eRow 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

Andre

2006-03-21, 3:16 am

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
>



Mike Brind

2006-03-21, 3:16 am


Andre wrote:

>
>
[vbcol=seagreen]
> 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

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com