title: How to call StoredProcedure from JavaScript code?
body: <p>I have email field and label</p>
  
  <pre><code>&lt;asp:TableRow runat="server"&gt;
                  &lt;asp:TableCell runat="server"&gt;
                      &lt;asp:TextBox runat="server" ID="txtUserEmail" onfocusout="emailVerification()" CssClass="forTextbox ui-corner-all" PlaceHolder="Enter your email"&gt;&lt;/asp:TextBox&gt;
                  &lt;/asp:TableCell&gt;
                  &lt;asp:TableCell runat="server"&gt;
                      &lt;asp:ScriptManager runat="server" ID="smForEmail"&gt;&lt;/asp:ScriptManager&gt;
                      &lt;asp:UpdatePanel runat="server" ID="upLblEmail"&gt;
                          &lt;ContentTemplate&gt;
                              &lt;asp:Label runat="server" ID="lblEmail"&gt;&lt;/asp:Label&gt;
                          &lt;/ContentTemplate&gt;
                      &lt;/asp:UpdatePanel&gt;
                  &lt;/asp:TableCell&gt;
              &lt;/asp:TableRow&gt;
  </code></pre>
  
  <p>And some other fields as well. </p>
  
  <p>I want when user move to next field <code>onfocusout="emailVerification()"</code> method is called. In this method I want to check either email is exists in database or not. For this I write stored procedure.</p>
  
  <pre><code>USE [CDistributors]
  GO
  /****** Object:  StoredProcedure [dbo].[sp_InsertUser]    Script Date: 2/17/2016 2:50:05 PM ******/
  SET ANSI_NULLS ON
  GO
  SET QUOTED_IDENTIFIER ON
  GO
  ALTER procedure [dbo].[sp_InsertUser]
  (@Email varchar(50) = null,
  @ReturnValue int = null)
  As
  Begin
  SET NOCOUNT ON;
  IF EXISTS (SELECT UserId from Users where Email = @Email)
  Begin
  
      return 0; -- Email already registered
  End 
  Else
  Begin
      return 1; -- Email is not registered yet
  End
  End
  </code></pre>
  
  <p>And JavaScript function is</p>
  
  <pre><code>// code for email verification
  $(function () {
      function emailVerification() {
           // What code to call stored procedure that return integer
      }
  });
  </code></pre>
  
  <p>Please help.</p>