H
haakern
Hi,
In an aspx page, I've got a TreeView and a detail form and a print
button. When the user clicks on the print button, I'd like to collapse
the TreeView and send the page to the printer.
Using Javascript, the print is easy:
<asp:ImageButton ID="btnPrint" runat="server" AlternateText="Print"
ImageUrl="~/images/print.gif"
OnClientClick="javascript:window.print();return false;" ToolTip="Print
page" />
However, I'm not able to combine the window.print() function with the
necessary method to collapse the TreeView (MyTreeView.CollapseAll()).
Anyone who's got any pointers on how to combine the Javascript print-
function with the ASP.NET TreeView.Collapse method on a single button?
Thanks!
Regards,
-Haakon-
In an aspx page, I've got a TreeView and a detail form and a print
button. When the user clicks on the print button, I'd like to collapse
the TreeView and send the page to the printer.
Using Javascript, the print is easy:
<asp:ImageButton ID="btnPrint" runat="server" AlternateText="Print"
ImageUrl="~/images/print.gif"
OnClientClick="javascript:window.print();return false;" ToolTip="Print
page" />
However, I'm not able to combine the window.print() function with the
necessary method to collapse the TreeView (MyTreeView.CollapseAll()).
Anyone who's got any pointers on how to combine the Javascript print-
function with the ASP.NET TreeView.Collapse method on a single button?
Thanks!
Regards,
-Haakon-