开发者

Action call and javascript call in MVC web application

How do you call a server side code and javascript in MVC? We are having a close button on every page. on click of close button there should be a call to controller action and the browser should close. Also if the user clicks the browse开发者_JAVA技巧r close the same controller action should be called before closing. Have anyone done similar stuff before


You need to implement an controller for that action. Javascript [ajax] call is a simple http-request, and you need to answer response as a json or xml. Google for an json serializer for java, there are many exists.

I can recommend you use jquery and google-json for this.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜