簡體   English   中英

如何停止按鈕上的頁面刷新單擊我正在使用更新面板,但它不起作用

[英]how to stop page refreshing on button click i am using update panel but it is not work

  1. 我正在使用表單提交驗證中的點擊

     <form id="form_Institute" class="form-horizontal" runat="server" onsubmit="submitForm();"> 
  2. 更新面板

      <input type="text" class="form-control" runat="server" id="txtintName" placeholder="Enter Institute Name" /> <asp:Button ID="btnSaveInstitute" class="btn blue" runat="server" Text="Save" OnClick="btnSave_Click" CausesValidation="false"></asp:Button> 

  3. 所有HTML控件的表單驗證表單的Java腳本,我給出一個控件示例

     $("#form_Institute").validate({ rules: { <%=txtintName.UniqueID %>:{ required:true, }, }); function submitForm(){ if(validate){ return false; } else { //document.form.submit(); return true; } } 

要使UpdatePanel工作,還需要在面板上的頁面上放置ScriptManager:

<asp:ScriptManager ID="ScriptManager1" runat="server" />

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM