here's the problem i'm running into.
I'm using a master page and the gridview is in the content section. The grid
view has 2 or 3 columns (based on the page) that are links using a template
field and <a href=> for the links. When the user clicks my print button, I
take them to a print preview page which is like a snap shot of the page but
without the master page surrounding it.
Here is my code I'm using. (if there is another easier way, I'm all for it)
this is my print preview page only:
<script language=javascript>
function printpr(OLECMDID)
{
if (opener && !window.opener.closed)
{
document.writeln(opener.document.getElementById('tbl').outerHTML);
}
}
</script>
<table cellpadding="0" cellspacing="0" border="0" width="100%" align=left>
<tr>
<td class="td_heading" width=100% align=left>
<asp:GridView ID="GridView1" runat="server" Width=100%>
</asp:GridView>
<script language="javascript" type="text/javascript">
document.writeln(opener.document.title);
</script>
</td>
</tr>
<tr>
<td class="td_general">
<script language="javascript" type="text/javascript">
<!--//
printpr(7);
//-->
</script>
</td>
</tr>
</table>
so what this is doing is taken the control (gridview in this case) from the
main page and showing it on the print page just as it is on the page. So I
need to remove the template field (link) on or before they ever show in the
print preview page
Eliyahu Goldin said:
What would you like to see in the example? How to use the events or how to
find the links?
--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
do you have an example or now of an example somewhere?
:
Two client-side events onbeforeprint and onafterprint are designed to
change
the page appearance before printing and to restore it after printing.. You
can find the links and hide/show them in these events with javascript.
--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
In my gridview I have 2 -3 template fields which are hyperlinks. I
allow
the
user to print this grid. When the grid prints it also prints the links,
how
can I take the user to a print preview page and not show the templated
fields, (hyperlinks) and also not print those fields?