第一种:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="web.WebForm1" % >
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server" >
<title ></title >
</head >
<body >
<form id="form1" runat="server" >
<script type="text/javascript" language="javascript" >
function aaa() {
form1.Button2.click();
}
</script >
<asp:Button ID="Button2" runat="server" Text="Button" OnClick="Button2_Click" Style="display: none;" / >
<input id="Button1" type="button" value="测试" onclick="aaa();" / >
</form >
</body >
</html >
第二种:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="web.WebForm1" % >
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server" >
<title ></title >
</head >
<body >
<form id="form1" runat="server" >
<asp:Button ID="Button2" runat="server" Text="Button" onclick="Button2_Click" style="display:none;" / >
<input id="Button1" type="button" value="测试" onclick="this.form.Button2.click();" / >
</form >
</body >
</html >
第三种:
<script type="text/javascript" language="javascript" >
function sendgoods(e) {
var returnvalue = window.showModalDialog("ProduceSendGoods.aspx",window, 'dialogHeight:580px;dialogWidth:800px;center:yes;status:yes;resizable:yes;help:no;scroll:yes;edge:sunken;');
if (returnvalue != "") {
__doPostBack("ctl00$ContentPlaceHolder_Content$hidbtn", "");
}
}
</script >
第四种:
function ClearDate(ControlName) {
document.getElementById(ControlName).click();
}