0

I have a long data to pass, Hence I have chosen post method to pass data. I used $.post("webform2.aspx",{data:message}) in webform1.aspx's button click. After it is posted I could not see webform2.aspx rendered. It still stays in webform1.aspx

Any way to pass the data and display the posted page.

Muthukumar Palaniappan
  • 1,496
  • 4
  • 21
  • 45

1 Answers1

1

This is ajax post .You can't redirected to new page that you have posted.

If you will use Ajax post ,you have to manually replace the result that you got by the ajax post in current page.

I give here simple example of Ajax Post

$.post( "ajax/test.html", function( data ) {
$( ".result" ).html( data );
});
Thamotharan Karuppiah
  • 1,615
  • 1
  • 10
  • 14
  • oh yes. you are right. Is there a possibility to post the data and redirect from scripts , like we do with postbackurl property in asp buttons. – Muthukumar Palaniappan Nov 18 '13 at 12:30
  • Tell me the requirement of your situation.then only i can tell u wich solution is better – Thamotharan Karuppiah Nov 19 '13 at 04:35
  • Your answer is very relevant to the question. However to solve this is discussed in this thread http://stackoverflow.com/questions/133925/javascript-post-request-like-a-form-submit and I solved it with that. Thanks for your help. To know more about my requirement, I Fetch data from a webservice and then post the data to a new page. So i needed a redirection + posting. I preferred post than GET because its a long data having special symbols. – Muthukumar Palaniappan Nov 19 '13 at 06:36