首页 新闻 搜索 专区 学院

求解决打印问题?代码请写出来

0
悬赏园豆:20 [已关闭问题] 关闭于 2011-05-27 09:50

后台————————

  protected void mytrsh_Click(object sender, EventArgs e)
    {
        string txtname = this.mytrsh.Text.Trim();
        if (txtname == "打印")
        {
           问题在这? 要是== 打印的话·怎么才能执行下面的脚本啊。
        }

 前台——————————

 <script type="text/javascript" language="javascript">

           function printht(btnPrintID) {
               var btnPrint = document.getElementById(btnPrintID);             
               pagesetup_null()
               return false;
           }

           function pagesetup_null() {

               try {

                   var RegWsh = new ActiveXObject("WScript.Shell")

                   hkey_key = "header"

                   RegWsh.RegWrite(hkey_root + hkey_path + hkey_key, "")

                   hkey_key = "footer"

                   RegWsh.RegWrite(hkey_root + hkey_path + hkey_key, "")

               } catch (e) { }
               window.print();
           }


           function ReturnView() {
               window.location = 'ClfFrame.aspx';
           }