weixin_33670786 2013-08-17 17:42 采纳率: 0%
浏览 18

代码后面的Ajax.BeginForm

Is it possible to use Ajax.BeginForm in the Controller? Cause I want to create a form in the Controller and then write it in the HTML after an AJAX request. Or is there a better way?


Now I use a PartialView but it doesn't work... How can I render it with Ajax?

  • 写回答

1条回答 默认 最新

  • 零零乙 2013-08-17 17:49
    关注

    I'm understanding your question as you want to return an HTML fragment as a response to a client's AJAX request, but do not know how.


    Of course there is a better way. It's MVC and you really shouldn't have View code in your Controller unless you truly can't help it. :)

    Just create a partial view and render it as a response by return PartialView().

    评论

报告相同问题?