0

I am using Jquery UI Multiple Values Autocomplete and I'm making the request to Server:

.autocomplete({
          source: function(request, response) {
              $.getJSON("handlers/autocomplete.ashx", {
                  term: extractLast(request.term)
              }, response);
          },

How to I get back the value of term in my .ashx handler?

I have tried Request.Form["TextBox1"] but I'm getting object reference not set to an intance of an object error. Is there any way I can get it directly?

Thanks

enb081
  • 3,831
  • 11
  • 43
  • 66

1 Answers1

2

pass TextBox1 value with the url

.autocomplete({
          source: function(request, response) {
              $.getJSON("handlers/autocomplete.ashx?TextBox1=curtxt", {
                  term: extractLast(request.term)
              }, response);
          },

Read TextBox1 from Handlers public void ProcessRequest(HttpContext context) {

        HttpRequest request = context.Request;
        HttpResponse response = context.Response;

string txtval = request["TextBox1"];

   }
user1358545
  • 88
  • 1
  • 6