Guest User

Guest User

  • Tech Writer
  • 31
  • 22.8k

How to read values in ASP from jQuery

May 9 2017 9:07 AM
  1. $(function () {  
  2.         $("#button").click(function () {  
  3.             alert("You clicked Submit button");  
  4.             $.ajax({  
  5.                 type: "POST",  
  6.                 url: "Insert.aspx",  
  7.                 data: "{'StudentId': 'B1111' ,'StudentName': 'Likhit'}"  
  8.             });  
  9.             $("#studenttable").append("<tr><td>B1111</td><td>Likhit</td></tr>");  
  10.         });  
Above is my jQuery function. 
  1. sid = Request.QueryString["StudentId"].ToString();  
This is how I am trying to retrieve data from function. But it's not working."
An exception of type 'System.NullReferenceException' occurred in App_Web_kqkv5dqo.dll but was not handled in user code
Additional information: Object reference not set to an instance of an object.
 Help me with suggestions.

Answers (2)