Umbraco联系表单错误。 " System.InvalidOperationException:只能在Http POST的上下文中使用UmbracoPageResult ..."

时间:2015-07-20 06:41:10

标签: forms umbraco contact

我从另一台服务器迁移了一个Umbraco网站,除了联系表单外,一切都在新服务器上运行正常。每当我从在线联系表单发布联系时,它会给出以下错误消息。如果有人能帮忙解决这个问题,我将不胜感激。

非常感谢提前。

显示错误:

    Server Error in '/' Application.

Can only use UmbracoPageResult in the context of an Http POST when using a SurfaceController form

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.InvalidOperationException: Can only use UmbracoPageResult in the context of an Http POST when using a SurfaceController form

Source Error: 


Line 10: </div>
Line 11: <div class="big-col-right">
Line 12:     @Html.Action("ContactUs", "ContactSurface")
Line 13: </div>

Source File: g:\pleskvhosts\test.clinisupplies.co.uk\httpdocs\Views\Contact.cshtml    Line: 12 

1 个答案:

答案 0 :(得分:1)

在这种情况下,不要将其渲染为子动作:

@Html.Action("ContactForm","ContactFormSurface")

您应该将视图渲染为部分视图:

@Html.Partial("ContactFormSurface/ContactForm")

...指向视图所在的位置。