How to pass parameter to the same page using java script in Asp.net

How to pass parameter to the same page using java script in Asp.net

top.location.href = '/IFGE/DeleteAllPrice/' + id;

works fine for redirecting to other pages, but doesn't work for redirecting to the same page

+3
source share
3 answers
window.location.href = window.location.href + "?ID=" + someid ;

You need to add window.location.href

+5
source

If I understand you correctly, are you trying to refresh / reload the page?

Try the following:

  • window.location.reload ();
  • history.go (0);
  • window.location.href = window.location.href;
0
source

AJAX http-Post .

- : ( . , )

var myObject = new Object();
myObject.FirstName = "david";
myObject.LastName = "Jones";
XmlHttpRequest vXHRequest = new XmlHttpRequest();
..
..
..
vXHRequest.send(myObject);

asp.net aspx page page_load,

Dictionart dict = JavaScriptSerializer.DeSerialize<Dictionary>(Request.Params["myObject"]);
-1

All Articles