0

I am manually using the (ASP.NET) javascript __doPostBack function. I am trying to be able to return a value from the server function that it calls. Google is not helping me out. Can someone tell me how I can do that.

I have an HTML button which has a click event that does a postback. Now I want it to return a value to my client to display to the user.

georg
  • 211,518
  • 52
  • 313
  • 390
Diane2
  • 160
  • 3
  • 16
  • Try using client callbacks instead. I have some examples at http://weblogs.asp.net/ricardoperes/wrapping-asp-net-client-callbacks – Ricardo Peres Feb 05 '15 at 18:56
  • You know when the page posts back, the entire page is reloaded from the server? So you don't "return" a value to the function. Instead, you can have the server embed some information in the new script it sends, or updated a HiddenField which the JavaScript can access. This appears to be a duplicate of [How to preserve JavaScript values after page reload in asp.net?](http://stackoverflow.com/questions/28323799/how-to-preserve-javascript-values-after-page-reload-in-asp-net/28324885#28324885). – mason Feb 05 '15 at 18:58
  • Ricardo, can response.redirect be used in those kind of callbacks? – Diane2 Feb 05 '15 at 19:21

0 Answers0