0

我的 mvc4 appln 中有一个屏幕,我正在使用 jquery.form 进行文件上传。文件上传是一个单独的 beginform,其他详细信息输入字段是一个单独的 beginform,但是在设计中,当一个表单与另一个文件上传重叠时不起作用。请帮我

提前致谢


这是代码:

    <div id="pvTransactionItemView" class="view" style="width:300px">
        @{        
            var loading = Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(@Html.Partial("pvLoading"), new[] { new MvcHtmlStringConverter() }));
        }
        @using (Html.BeginForm("SavePostedQuestionData", "AuditQuestionnaire", FormMethod.Post, new { Id = "frmAuditQuestionaire" }))
        {    

            <div class="paneContent" style="position:relative">

                <div style="width:100%">
                    <div>                    
                             <div class="video-item">
                                 <div style="float: left; width:10%;padding-top: 25px;">@Html.Label("Question", new { @Class = "label" })</div>
                                 <div style="float: left; width:10% ;padding-left: 40px;">@Html.TextAreaFor(m => m.Questions.Question.Question)</div>
                             </div>                    
                    </div>
                </div>
                    <div style="float: left">

                        <div class="video-item" style="float: left;width :50%; Margin-top:-70px;Margin-left:450px">
                             @*2*@
                            @Html.HiddenFor(m => m.Questions.Question.UnitsofMeasurement)
                            <div style="float: left; padding-top: 4px; font-weight: bold">@Html.Label("UOM")</div>
                            <div style="float: left; padding-left: 65px;">@(Html.Kendo().DropDownList().Name("ddlUOM")
                                .HtmlAttributes(new { style = "width:150px" })
                                .OptionLabel("Select UOM...")
                                .DataTextField("UnitofMeasure")
                                .DataValueField("UnitofMeasurementID")
                                .BindTo(Model.UOMs)
                                .Events(e=>e.Change("changeUOM"))


                            )</div>
                        </div>


                        <div style="float: left; Margin-top:-35px;Margin-left:5px">
                            @Html.HiddenFor(m => m.Questions.Question.ComponentID)
                            <div style="float: left; padding-top: 4px; font-weight: bold">@Html.Label("Component")</div>
                            <div style="float: left; padding-left: 32px;">@(Html.Kendo().DropDownList().Name("ddlComponent")
                                .HtmlAttributes(new { style = "width:150px" })
                                .OptionLabel("Select Component...")
                                .DataTextField("Name")
                                .DataValueField("ComponentID")
                                .BindTo(Model.Components)
                                .Events(e => e.Change("changeComponent"))
                            )</div>
                        </div>

                        <div class="video-item" style="Margin-top:-30px;Margin-left:450px">
                            @Html.HiddenFor(m => m.Questions.Question.KRAID)
                            <div style="float: left; padding-top: 4px; font-weight: bold">

                                @Html.Label("KRA")
                            </div>
                            <div style="float: left; padding-left: 72px;">
                                @(Html.Kendo().DropDownList().Name("ddlKRA")
                                                .HtmlAttributes(new { style = "width:150px" })
                                                .OptionLabel("Select KRA...")
                                                .DataTextField("KRAName")
                                                .DataValueField("KRAID")
                                                .BindTo(Model.KRAs)
                                                .CascadeFrom("ddlComponent")
                                                .Events(e => e.Change("changeKRA"))

                   )
                                @Html.HiddenFor(m => m.Questions.Question.CreatedDt)
                                @Html.HiddenFor(m => m.Questions.Question.ModifiedDt)
                                @Html.HiddenFor(m => m.Questions.Attachment.DocumentName)
                                @Html.HiddenFor(m => m.Questions.Attachment.DocumentPath)
                                @Html.HiddenFor(m => m.Questions.Attachment.CreatedDt,DateTime.Now)
                                @Html.HiddenFor(m => m.Questions.Attachment.ModifiedDt,DateTime.Now)
                                @Html.HiddenFor(m => m.Questions.Attachment.QuestionID)
                            </div>
                        </div>

                        <div class="video-item">
                            @Html.HiddenFor(m => m.Questions.Question.AuditParametersID)
                            <div style="float: left; padding-top: 4px; font-weight: bold">

                                @Html.Label("Parameter")
                            </div>
                            <div style="float: left; padding-left: 39px;">
                                @(Html.Kendo().DropDownList().Name("ddlParameter")
                                                .HtmlAttributes(new { style = "width:150px" })
                                                .OptionLabel("Select Parameter...")
                                                .DataTextField("ParameterName")
                                                .DataValueField("AuditingParametersID")
                                                 .BindTo(Model.Parameters)
                                                 .Events(e => e.Change("changeParameter"))


                   )
                            </div>
                        </div>

                         <div class="video-item">
                            <div style="float: left; padding-top: 4px; font-weight: bold; padding-left: 0px">

                                @Html.Label("Is objective")
                            </div>
                            <div style="float: left; padding-left: 34px;">
                                 @Html.CheckBoxFor(m => m.Questions.Question.IsObjective)
                            </div>
                        </div>

                    </div>

    @*//////////////////////////////////////////////////////////*@

                    <div style="float: left; padding: 0.5em 0">

                        @*<div style="float: left">
                            @Html.HiddenFor(m => m.Questions.Question.ComponentID)
                            <div style="float: left; padding-top: 4px; font-weight: bold">@Html.Label("Component")</div>
                            <div style="float: left; padding-left: 64px;">@(Html.Kendo().DropDownList().Name("ddlComponent")
                                .HtmlAttributes(new { style = "width:150px" })
                                .OptionLabel("Select Component...")
                                .DataTextField("Name")
                                .DataValueField("ComponentID")
                                .BindTo(Model.Components)
                                .Events(e => e.Change("changeComponent"))


                            )</div>
                        </div>*@

                        <div style="float: left; padding-left: 90px;">
                            @*#*@
                            <div style="float: left; padding-top: 4px; font-weight: bold"></div>
                            <div style="float: left; padding-left: 62px;"></div>
                        </div>
                    </div>

                    <div style="float: left;">

                        @*<div style="float: left; margin-top: -33px;">
                            @Html.HiddenFor(m => m.Questions.Question.KRAID)
                            <div style="float: left; padding-top: 4px; font-weight: bold">

                                @Html.Label("KRA")
                            </div>
                            <div style="float: left; padding-left: 115px;">
                                @(Html.Kendo().DropDownList().Name("ddlKRA")
                                                .HtmlAttributes(new { style = "width:150px" })
                                                .OptionLabel("Select KRA...")
                                                .DataTextField("KRAName")
                                                .DataValueField("KRAID")
                                                .BindTo(Model.KRAs)

                                                .CascadeFrom("ddlComponent")
                                                .Events(e => e.Change("changeKRA"))

                   )
                                @Html.HiddenFor(m => m.Questions.Question.CreatedDt)
                                @Html.HiddenFor(m => m.Questions.Question.ModifiedDt)
                                @Html.HiddenFor(m => m.Questions.Attachment.DocumentName)
                                @Html.HiddenFor(m => m.Questions.Attachment.DocumentPath)
                                @Html.HiddenFor(m => m.Questions.Attachment.CreatedDt,DateTime.Now)
                                @Html.HiddenFor(m => m.Questions.Attachment.ModifiedDt,DateTime.Now)
                                @Html.HiddenFor(m => m.Questions.Attachment.QuestionID)
                            </div>
                        </div>*@

                    </div>

                    <div style="float: left;">

                        @*<div style="float: left; margin-top: 10px;">
                            @Html.HiddenFor(m => m.Questions.Question.AuditParametersID)
                            <div style="float: left; padding-top: 4px; font-weight: bold">

                                @Html.Label("Parameter")
                            </div>
                            <div style="float: left; padding-left: 120px;">
                                @(Html.Kendo().DropDownList().Name("ddlParameter")
                                                .HtmlAttributes(new { style = "width:150px" })
                                                .OptionLabel("Select Parameter...")
                                                .DataTextField("ParameterName")
                                                .DataValueField("AuditingParametersID")
                                                 .BindTo(Model.Parameters)
                                                 .Events(e => e.Change("changeParameter"))


                   )
                            </div>
                        </div>*@

                       @* <div style="float: left; margin-top: 10px; padding-left: 60px">
                            <div style="float: left; padding-top: 4px; font-weight: bold; padding-left: 30px">

                                @Html.Label("Is objective")
                            </div>
                            <div style="float: left; padding-left: 78px;">
                                 @Html.CheckBoxFor(m => m.Questions.Question.IsObjective)
                            </div>
                        </div>*@
                        <br />
                        <p style="float:left;Margin-top:-50px;Margin-left:500px">
                            <input type="submit" value="Save Changes" style="float:right;" />
                        </p>
                    </div>
                </div>

    @*<input type="submit" value="Save" id="btnSvae"  />*@
        }
         @*style="float:left;Margin-top:-250px;Margin-left:350px"*@
        <div id="content7" style="float:left;Margin-top:-235px;Margin-left:650px" >
            @using (Html.BeginForm("FileUpload", "Audit", FormMethod.Post, new { enctype = "multipart/form-data", id = "ajaxUploadForm" }))
            {            
                <input type="hidden" name="pathFolder" value="Audit" />
                <input type="file" name="Audit" /><br /><br />
                <input type="submit" name="Submit" id="Submit" value="Upload" />
            }
        </div>
    </div>

文件上传表单位于表单名称的末尾 -> ajaxUploadForm。

4

0 回答 0