开发者

ASP.NET MVC - How To Refresh View From Actionmethod as a response to request?

I have an action-method in a controller that takes requests coming from a variety of different views.

It is somewhat of a utility method and I simply want it to accept the parameters it is given - do something - and then refresh the view tha开发者_运维百科t sent the request.

Right now, the only way I see to do this is by having the method figure out what view sent it the info and do a:

return RedirectToAction("method", "controller");

For each possibility (or something similar to that).

Is there a more general way I can make my method just re-render the current view without having to explicitly identify it?

-Thanks


Your best bet is to use jQuery to post the data then utilize the results as you see fit. Otherwise you can pass in the action/controller name in the post and use them dynamically to redirect.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜