得到页面所有的form内对象数值——————为一个控件加一个客户端属性

foreach (string str in Request.Form.AllKeys)
        {
            this.Response.Write(str+":"+this.Request.Form [str].ToString ()+"<br />");
        } 

为一个控件加一个客户端属性
  Page.ClientScript.RegisterStartupScript(this.GetType(), "myScript",
   "function NewWin() { showModalDialog('2.htm', '"+Label_Num.Text+"', 'dialogWidth:600px; dialogHeight:420px; status:0; help:0;scroll:no;resizable:yes'); }", true);       }


   Button1.Attributes["onclick"] = "NewWin()";

原文地址:https://www.cnblogs.com/ma/p/671959.html