开发者

asp.net mvc - RenderAction problems

I'm not quite sure I understand what Html.RenderAction() does. I've just noticed one weird behavior when using it:

In View/Contacts/Edit.aspx I used Html.RenderAction("ModalAddNote") which 开发者_如何学编程contains form for adding Notes for Contact. This is for ajax usage (it is opened in modal dialog). Problem occurs when I create method ModalAddNote: now, when I submit page for editing Contact I am being redirected to Contacts/ModalAddNote and not to Contacts/Edit. If I delete Html.RenderAction("ModalAddNote") then it works fine. Why is that so and how to control it?


I found where the problem was... I had two ModalAddNote methods - one without and one with HttpPost, so when the page was submitted, Html.RenderAction("ModalAddNote") would call the one with HttpPost attribute

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜