<style>
@media print {
   .ptn {display:block;}   
   .notptn {display:none;}
}
</style>
<div class="notptn"> 不打印</div><div class="ptn"> 打印</div><A href="javascript:doprint()">【打印该页】</A>放到一个页面打印预览看一下。。
你重要在aspx页面将你的打印按钮 的CssClass="notptn"即可

解决方案 »

  1.   

    调用javascript
    btnPrint是打印按钮的ID
    则document.all("btnPrint").style.display = "none";
    window.print();
    document.all("btnPrint").style.display = "";
      

  2.   

    <HEAD>
    <title>审批车辆资料打印</title>
    <meta content="Microsoft Visual Studio 7.0" name="GENERATOR">
    <meta content="C#" name="CODE_LANGUAGE">
    <meta content="JavaScript" name="vs_defaultClientScript">
    <meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
    //这里定义一个样式
    <style type="text/css"> @media Screen { .onlyPrint { DISPLAY: none }}
    @media Print { .onlyShow { DISPLAY: none }///这个只显示不打印
    .onlyPrint { PAGE-BREAK-BEFORE: always }///这个是打印不显示}
    </style>
    </HEAD>
    用法:
    <table>
    <tr>
    <td class=onlyShow>////这样就只显示不打印了!正好是你想要的
    ....................
    </td>
    </tr>
    <tr>
    <td>
    </td class=onluPrint>////这样就只打印不显示!就是说在客户端的页面上看不到,但打印,打印是看的到!你试试!
    .............................
    </tr>
    </table>
      

  3.   

    <style>
    @media print 
    {
    .onlyShow{display:none;
              }
    }
    </style>
    <input type='button' class="onlyShow" value='打印'>
      

  4.   

    我按照chenee54321和007Delphi的做法,还是不行,同时保存的时候提示我Unicode字符将不能被保存,要用另存为编码保存
      

  5.   

    <script language="javascript">
    <!--
    function myprint(f) {
    f.style.visibility = 'hidden';
    document.all.item("btnClose").style.display="none";
    //document.Form1.btnClose.display="none";
    //document.Form1.btnClose.visibility = 'hidden';
    document.all.WebBrowser.ExecWB(7,1);
    f.style.visibility = 'visible';
    window.opener = null;
    window.close();
    this.visible = false;
    return true;
    }
    function myclose(){
    window.opener = null;
    window.close();
    return true;
    }
    // -->
    </script>
    <INPUT id="btnPrint" style="BORDER-TOP-STYLE: none; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: transparent; TEXT-DECORATION: underline; BORDER-BOTTOM-STYLE: none" onclick=" return myprint(this);" type="button" value="打 印">