Sunday, 15 April 2012

asp.net - Send and retrieve key/value pair from MVC page to aspx page using POST Method -



asp.net - Send and retrieve key/value pair from MVC page to aspx page using POST Method -

i have mvc page hyperlink. hyperlink redirects aspx page. want send info (key/value pair) mvc page aspx page when redirect aspx page. (mvc framework 5 , .net framework 4.5)

and read key/value pair in page_load of aspx page.

i can't utilize query string or session or cookies.

how can accomplish using http-post?

$('a#yourlinkid').on('click', function(){ $.post("controller/method", { par1: "test", par2: "test2" } ); });

and alter page

$('a#yourlinkid').on('click', function(){ $.post("controller/method", { par1: "test", par2: "test2" }, window.location.href = "controller/method"); });

asp.net asp.net-mvc asp.net-mvc-4 http-post

No comments:

Post a Comment