i'm not sure why you'd want print through a link rather than just using the
browsers print menu item.
this sure seems like doing things the hard way
just setup a second css and include it in your AFTER all other stylesheets
include the attribue media="print"
create a class in this stylesheet create a class as such :
..noprint
{
position:absolute;
top:-10000;
}
just making items invisible causes havoc with some browsers - you have to
physically move these items out of view
you may have to play with visible, width , height as well.
and override any other classes' attributes as required - font size ,
positions etc.
then assign this class to any items you want to hide when printing
<input type='button' class='noprint />
You can use this technique to print something completely different than what
is viewed in the browser by over riding class properties.
You can also use this technique to hide items in the browser view and
display them when printing
check out
http://www.hgha.ca/Rep/PeeweeB.htm?tab=Schedule (or any other page
on this site ) and compare what you see in the browser to what you see in
print/preview.
Gerry
"Jeff Dillon" <je********@hotmail.com> wrote in message
news:Oq**************@TK2MSFTNGP05.phx.gbl...
Private Sub lnkPrint_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles lnkPrint.Click
m_bPrint = True
GetDBData()
UpdateDataView()
Me.NavigationControl1.Visible = False
Me.NavigationControl2.Visible = False
Me.lnkPrint.Visible = False
Me.imgPrint.Visible = False
Me.lblAppTitle.Font.Size = m_fntUnit
Me.lblBanner.Font.Size = m_fntUnit
Me.lblReportHeader.Font.Size = m_fntUnit
Me.lblLoginBar.Font.Size = m_fntUnit
Me.dgDataGrid.Font.Size = m_fntUnit
m_bPrint = False
Response.Write("<script>window.print();</script>")
End Sub
"J Ames" <j_********@yahoo.com> wrote in message
news:OD**************@TK2MSFTNGP02.phx.gbl...I have an ASP.NET (VB) form that has two drop downs, a horizontal rule
anda button. The button invokes a stored procedure and several tables are
created on the page with data populated. I want to create a link to
printthe page, but I don't want the drop downs or the button to print, only
thetables. How can this be done? I know how to use a CSS file to disallow
the entire page from being printed, but I don't know how to apply this to
only certain controls. Any advice is greatly appreciated.
Thanks