使用HTML.BeginForm()进行ASP.NET成功回调

时间:2015-06-05 15:38:54

标签: javascript c# asp.net ajax

我需要在ASP.NET中为现有表单添加功能。在现有验证已经清除并且表单已提交并且尽可能少地更改现有代码之后,我想激活Javascript函数。

我的问题:
HTML.BeginForm()是否有成功的回调? 我正在尝试复制this SO answer使用Ajax.BeginForm()

的功能

我的约束:
所有的验证和渲染都已经到位,所以我希望在视图级别使用HTML.BeginForm()而不是Ajax.BeginForm()来完成此操作,如果可能的话,根本不会弄乱控制器。

现有表格:

 @using (Html.BeginForm("SignUp", "Location", FormMethod.Post))
    {
        <div class="clearfix">
            <input type="hidden" name="Member.Page" value="@(ViewBag.PageType)" />
            <input id="inputMemberType" type="hidden" name="Member.Type" value="@(Enumeration.Subscription.Global)" />
            @Html.TextBoxFor(model => model.Member.Email, new { id = "textEmail", @class = "left", placeholder =  (LanguageManager.GetText(LanguageConst.SIGNUP_PH_EMAIL)) })
            <input id="buttonSignUp" type="submit" class="left" value="@(LanguageManager.GetText(LanguageConst.SIGNUP_BTN_SIGNUP))" />
            <div class="left">
                @Html.ValidationMessageFor(model => model.Member.Email, string.Empty, new { @class = "container-error", style = "color:white;" })
            </div>
        </div>
    }

我对ASP.NET很不熟悉,所以感谢任何帮助。

相关:
BeginForm Documentation

0 个答案:

没有答案