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();"
posted @   Blue Sky ......  阅读(294)  评论(0编辑  收藏  举报
努力加载评论中...
点击右上角即可分享
微信分享提示