title: I am getting 500 internal server error ,in POSTMAN
body: <p>I am trying to get password from database when user enters username .I am doing it through JQUERY ajax .When I am trying to run the request on postman I am getting 500 internal server error.
  This is my .aspx code</p>
  <pre><code>&lt;%@ Page Language=&quot;C#&quot; AutoEventWireup=&quot;true&quot; CodeBehind=&quot;WebForm4.aspx.cs&quot; Inherits=&quot;Codefirstapproachtry.WebForm4&quot; %&gt;
  
  &lt;!DOCTYPE html&gt;
  
  &lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
  &lt;head runat=&quot;server&quot;&gt;
      &lt;title&gt;&lt;/title&gt;
      &lt;script src=&quot;jquery/jquery-3.5.1.min.js&quot;&gt;&lt;/script&gt;
      &lt;script src=&quot;jquery/getpassword.js&quot;&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;form id=&quot;form1&quot; runat=&quot;server&quot;&gt;
            &lt;div&gt;
              
              &lt;asp:TextBox ID=&quot;dirtext&quot; runat=&quot;server&quot; &gt;&lt;/asp:TextBox&gt;
              &lt;asp:Button ID=&quot;dirsubmit&quot; runat=&quot;server&quot; Text=&quot;Button&quot; OnClick=&quot;dirsubmit_Click&quot; /&gt;
             
  
                &lt;br /&gt;
                &lt;br /&gt;
                &lt;asp:Label ID=&quot;Label1&quot; runat=&quot;server&quot; Text=&quot;Label&quot;&gt;&lt;/asp:Label&gt;
             
  
          &lt;/div&gt; 
      &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  <p>This is my .js file</p>
  <pre><code>$(document).ready(function () {
     
    
  
      $('#dirsubmit').click(function () {
      var objuser = {
          name: $('#dirtext').val(),
  
      };
  
      var param = {
          user: objuser
      };
  
          $.ajax({
              type: &quot;POST&quot;,
              url: &quot;WebForm4.aspx/GetPassList1&quot;,
              data: JSON.stringify(param),
              contentType: &quot;application/json; charset=utf-8&quot;,
              dataType: &quot;json&quot;,
              success: function (response) {
                  alert(&quot;Hi&quot;);
                  console.log(response);
                  var result = JSON.parse(response.d);
                  if (result.Status == 1) {
                      alert(result.Message);
                     
                  }
  
              },
              error: function (response) {
                  toastr.error(&quot;ajax error&quot;, &quot;error&quot;);
              }
          });
  });
  });
  </code></pre>
  <p>And this is my GetPassList1 function which I am calling through JQUERY ajax</p>
  <pre><code>public static string GetPassList1(User user)
          {
  
  
              using (var db = new userdetailsDBContext())
              {
  
                 
                  var queryStud = db.UserDetails.Where(s =&gt; s.name == user.name)
                                                .Select(s =&gt; new { s.pass });
                  return JsonConvert.SerializeObject(queryStud);
                  
  
  
              }
          }
  </code></pre>
  <p>This is the data I am providing on Postman</p>
  <pre><code>{
      &quot;user&quot;: {
          &quot;name&quot;: &quot;Pragya&quot;
         
      }
  }
  </code></pre>
  <p>And I am getting 500 internal server error</p>