开发者

Passing a JSON object to a ASPX page from Javascript

开发者 https://www.devze.com 2023-03-04 02:29 出处:网络
I\'m have a page that\'s rendered in JS that loads some info from the server that the user can edit. The page has a \"pop out\" option (similar to gmail when you compose an email and can pop it out to

I'm have a page that's rendered in JS that loads some info from the server that the user can edit. The page has a "pop out" option (similar to gmail when you compose an email and can pop it out to another window).

Here's my problem, if the user changes any of the info in the page I don't want that to be lost when the page is popped out. There is far too much information in the page to pass it all in the URL so I was thinking the best way would be to send a JSON object to the ASPX page and have it parse the information into itself.

I've seen this done through Web Services but I w开发者_如何学Pythonas wondering if it would be possible to do it just through an ASPX page. Am I even on the right track or is there a better way to get the data from the JS code into the ASPX page that I'm overlooking?

Thanks!


You could create a PageMethod on the ASPX page, and use that to process the JSON data.

Take a look at this nice article from Encosia.com: http://encosia.com/2008/05/29/using-jquery-to-directly-call-aspnet-ajax-page-methods/


the answer is yes. you can use call page method from client side

here is an example using jQuery to directly call ASP.NET AJAX page methods

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号