我有这个表单(我把代码放在下面),我需要添加一个按钮,通过POST将表单提交到hubspot的url,任何想法请...
@model OxfordEconomics.Users.ViewModels.CreateTrialUserHubspotViewModel
@using OxfordEconomics.Users.ViewModels;
@using (Html.BeginFormAntiForgeryPost(Url.Action("FreeTrialForm","FreeTrial", new { area = "OxfordEconomics.Users" }))) {
<div>
<div class="span12">
<h1>@T("Free trial registration form")</h1>
<p>@T("Please fill out the form below to request a free trial, or ") <a href="/about-us/sales-and-service/inquiries">@T("contact a service representative")</a>. </p>
<p class="required-fields"><i class="icon-exclamation-sign red-icon"></i>: Required fields</p>
</div>
<fieldset>
<div>
@Html.LabelFor(model => model.FirstName)
</div>
<div>
@Html.EditorFor(model => model.FirstName)
<i class="icon-exclamation-sign red-icon" title="Required field"></i>
</div>
<div>
@Html.LabelFor(model => model.LastName)
</div>
<div>
@Html.EditorFor(model => model.LastName)
<i class="icon-exclamation-sign red-icon" title="Required field"></i>
</div>
<div class="row">
<div class="span8 offset1">
<button type="submit" name="submit.Filter" value="@T("Filter")">@T("Apply")</button>
</div>
</div>
</fieldset>
</div>
}
答案 0 :(得分:2)
只需使用普通表单标记而不是反伪造助手调用。