asp.net 點(diǎn)擊按鈕提交后使按鈕變灰不可用
來源:懂視網(wǎng)
責(zé)編:小采
時(shí)間:2020-11-27 22:44:27
asp.net 點(diǎn)擊按鈕提交后使按鈕變灰不可用
asp.net 點(diǎn)擊按鈕提交后使按鈕變灰不可用:.aspx 代碼如下:<script language=javascript> function abc() { var mybutton=document.getElementById(Submit1); mybutton.disabled=true; //變灰 __doPostBack(Submit1,); //執(zhí)行服務(wù)
導(dǎo)讀asp.net 點(diǎn)擊按鈕提交后使按鈕變灰不可用:.aspx 代碼如下:<script language=javascript> function abc() { var mybutton=document.getElementById(Submit1); mybutton.disabled=true; //變灰 __doPostBack(Submit1,); //執(zhí)行服務(wù)
.aspx
代碼如下:
<script language="javascript">
function abc()
{
var mybutton=document.getElementById("Submit1");
mybutton.disabled=true; //變灰
__doPostBack("Submit1",""); //執(zhí)行服務(wù)器端Submit1的click事件
}
</script>
<form id="Form1" method="post" runat="server">
...
<INPUT id="Submit1" type="submit" value="開始上傳" name="Submit1" runat="server">
....
</form>
.cs
代碼如下:
private void Page_Load(object sender, System.EventArgs e)
{
...
this.GetPostBackEventReference(Submit1); //這句很關(guān)鍵,有這句才能讓客戶端執(zhí)行服務(wù)器端事件。
Submit1.Attributes.Add("onclick","abc();");
....
}
聲明:本網(wǎng)頁內(nèi)容旨在傳播知識(shí),若有侵權(quán)等問題請(qǐng)及時(shí)與本網(wǎng)聯(lián)系,我們將在第一時(shí)間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com
asp.net 點(diǎn)擊按鈕提交后使按鈕變灰不可用
asp.net 點(diǎn)擊按鈕提交后使按鈕變灰不可用:.aspx 代碼如下:<script language=javascript> function abc() { var mybutton=document.getElementById(Submit1); mybutton.disabled=true; //變灰 __doPostBack(Submit1,); //執(zhí)行服務(wù)