Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > open in new window

Reply
Thread Tools

open in new window

 
 
Andre
Guest
Posts: n/a
 
      03-20-2006
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

 
Reply With Quote
 
 
 
 
Mike Brind
Guest
Posts: n/a
 
      03-20-2006

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

 
Reply With Quote
 
 
 
 
Andre
Guest
Posts: n/a
 
      03-20-2006
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
>



 
Reply With Quote
 
Mike Brind
Guest
Posts: n/a
 
      03-21-2006

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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Window.Open get new tab instead of new window in FireFox Fredzidd@gmail.com Javascript 1 02-29-2008 03:06 AM
window.open() doesn't open new Window in Opera PC HUA Javascript 2 05-19-2004 02:29 AM
Need to open a new browser window, not a new window Gordon ASP General 3 04-16-2004 10:46 PM
Re: open window a new window and retrieve data from it. C# Cheryl ASP .Net 2 11-13-2003 11:07 AM
open window a new window and retrieve data from it. C# Cheryl ASP .Net 2 11-12-2003 05:30 AM



Advertisments