open in new window

A

Andre

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
 
M

Mike Brind

Andre said:
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.
 
A

Andre

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
 
M

Mike Brind

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top