开发者

asp.net mvc - RenderAction problems

开发者 https://www.devze.com 2023-01-05 09:28 出处:网络
I\'m not quite sure I understand what Html.RenderAction() does. I\'ve just noticed one weird behavior when using it:

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

精彩评论

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