Button onclick事件

一.javascript中获取服务器端控值件用value
1.用表单的elements集合获取控件值
theform=document .forms["form1"];
theform .elements["TextBox3"].value
2.用getElementById
document.getElementById ("TextBox1").value 
二.javascript实现click事
1.在page_load 事件中添加
Button1.Attributes["onclick"]="javascript:  函数名()"; 
Button1.Attributes.Add("onclick","javascript:getSum()");
2.在脚本中添加
OnClientClick="getSum();"
原文地址:https://www.cnblogs.com/hubcarl/p/1412715.html