将Ajax中的发送值null提交给Controller

时间:2015-07-17 21:01:56

标签: ajax asp.net-mvc twitter-bootstrap asp.net-ajax submit

我在Ajax.BeginForm“father”中有几个ajax.begin表单。

“父”函数或第一个Ajax.BeginForm的问题需要放置另一个空的begin.form,但是根据地方或父亲发送“nulls”信息的方式或者第一个Ajax.BeginForm发送提交给Ajax.BeginForm“父亲”。

我的代码:

@using (var f = Html.Bootstrap().Begin(new Form("","").Id("").HtmlAttributes(new { ReturnUrl = Request.QueryString["ReturnUrl"] })))
{
using (Ajax.BeginForm("", "", new AjaxOptions { }))
{

}

using (@Ajax.BeginForm("SaveChanges", "Requests", null, new AjaxOptions { HttpMethod = "POST" }, null))
{
    using (Ajax.BeginForm("", "", new AjaxOptions { }))
    {

    }

    using (@Ajax.BeginForm("AddMoney","Requests", null, new AjaxOptions { HttpMethod = "POST" }, null))
    {
   <div class="row">
    <div class="col-md-12">
        <div class="box">
            <div class="box-title">
                <h3>
                    <i class="fa fa-bars"></i>Money</h3>
                <div class="box-tool">
                    <label class="control-label">
                    </label>
                    <a data-action="collapse" href="#"><i class="fa fa-chevron-up"></i></a>
                </div>
            </div>
            <div class="box-content">
                <div class="row">
                    <div class="col-md-3">
                        <div class="form-group">
                            @f.FormGroup().TextBoxFor(_ => _.Money).Class("form-control").HtmlAttributes(new { mask = "999999999999" })
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>          

}
 using (@Ajax.BeginForm("AddDate", "Request", null, new AjaxOptions { HttpMethod = "POST"}, null))
    {
<div class="row">
    <div class="col-md-12">
        <div class="box">                    
                <div class="row">                       

                    <div class="col-md-2" id="divDtFinalCorrecao" style="display: none;">
                        <div class="form-group">
                            @f.FormGroup().TextBoxFor(_ => _.date).Class("datepicker"))
                        </div>
                    </div>
                </div>
        </div>
</div>
</div>
    }

0 个答案:

没有答案