0

I am passing JSON data to asp.net web form in script. How can I retrieve the id and use in web form

$.ajax({
  type: "GET",
  url: 'Edit.aspx',
  cache: false,
  data: ({
    id: id,
    page: lastDirecotry
  }),
  success: function (data) {
    $("#dialog").html(data);
    $("#dialog").dialog("open");
  }
});
2
  • what is the id here? Commented Feb 13, 2015 at 20:21
  • Please add more context and exposition. Commented Feb 13, 2015 at 20:21

2 Answers 2

1

This is the key piece of information:

 type: "GET"

Since this is a GET request, the data is going to be query string key/value pairs. So if this is the data being sent:

{ id: id, page: lastDirecotry }

Then you can get those values server-side from here:

var id = Request.QueryString["id"];
var page = Request.QueryString["page"];
Sign up to request clarification or add additional context in comments.

Comments

0

in success method you can get data.id to fetch id ,and to fetch page parameter data.page will give you lastDirectory

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.