title: Is there a way to active a .cs function and a javascript function with the same button ( both onclick)?
body: <p><strong>Problem</strong></p>
  
  <p>I want to create a modal "Forgot Password" , in this modal there is a button "send code" and when you click on that button it should activate the .cs function (in this function it will create a random code and will mail the code to the user) and the button "Send code" should also activate the javascript function  ( this function will close the current modal and go to the next modal)  at the same time.</p>
  
  <p><strong>What I already tried</strong></p>
  
  <p>I tried:
  To  put the in the same onclick event ,
  Put the cs function onserver click and the JS function onclick 
  Tried an a tag button 
  and an input button</p>
  
  <p><strong>Button</strong></p>
  
  <pre><code>&lt;asp:Button ID="SendCode" Text="Send code" runat="server" OnClick="VerzendCode;b();" CssClass="btn btn-default" Visible="true" /&gt;
  </code></pre>
  
  <p><strong>CS function</strong></p>
  
  <pre><code>public partial class Site1 : System.Web.UI.MasterPage
  { protected void VerzendCode(object sender, EventArgs e)
      {
         string code = generateCode();
          MailMessage mail = new MailMessage("demert.deswert@gmail.com", TxtEmailWW.Text);
          SmtpClient client = new SmtpClient();
          client.UseDefaultCredentials = false;
          client.DeliveryMethod = SmtpDeliveryMethod.Network;
          client.Port = 587;
          client.Host = "smtp.gmail.com";
          client.EnableSsl = true;
          client.Credentials = new System.Net.NetworkCredential("demert.deswert@gmail.com", "789632145");
          mail.BodyEncoding = Encoding.UTF8;
          mail.DeliveryNotificationOptions = DeliveryNotificationOptions.OnFailure;
          mail.Subject = "Wachtwoord vergeten";
          mail.Body = "Beste  dit is de code om uw wachtwoord te resetten";
          mail.Body += Environment.NewLine + code;
          client.Send(mail);  
      }
   }
  </code></pre>
  
  <p><strong>JS function</strong></p>
  
  <pre><code>$(function b() {
      $("#BtnVerzendcode").click(function () {
          $('#WWReset').modal('show');
            $('#WWvergeten').modal('hide');
      });
  });
  </code></pre>
  
  <p><strong>Expection</strong></p>
  
  <p>I expect that both functions active at the sime time and with the same button</p>