showing message box on control's modal popup extender

后端 未结 1 2007
栀梦
栀梦 2021-01-23 15:19

I have a control inside a page that has the following modal popup extender:


    

        
相关标签:
1条回答
  • 2021-01-23 16:05

    Just use JavaScript, there a bunch of ways to do it here is one example:

    <asp:Button id="btn_SaveCompleted" runat="server" Text="Complete"  
       OnClientClick="return ValidateTheTextbox();"OnClick="btn_SaveCompleted_Click" />
    
    
    <script>
         function ValidateTheTextbox()
         {
              var txtbox = document.getElementById('<%= txt_CompletedComment.ClientID %>');
              if(txtbox.value=="")
              {
                  alert('Please enter a comment.');
                  return false; //suppress the submit button
              }
              return true; //let the form submit
         }
    </script>
    
    0 讨论(0)
提交回复
热议问题