Asp.net mvc 要生成具有完整样式的动态控件吗

Asp.net mvc 要生成具有完整样式的动态控件吗,asp.net-mvc,dynamic-controls,Asp.net Mvc,Dynamic Controls,您好,我想在我的页面上有“添加更多”按钮,该按钮可以复制现有表单,只要我单击“添加更多”按钮,就可以复制任意次数,就像linkedin为教育和体验部分所做的一样 我想要具有完整样式的动态控件 <div class="form-horizontal" style=" border: 1px solid #c6c7cc; border-radius: 5px; font: 14px/1.4 " helvetica="" neue",="" helvetica,="" ar

您好,我想在我的页面上有“添加更多”按钮,该按钮可以复制现有表单,只要我单击“添加更多”按钮,就可以复制任意次数,就像linkedin为教育和体验部分所做的一样

我想要具有完整样式的动态控件

<div class="form-horizontal" style="    border: 1px solid #c6c7cc;
    border-radius: 5px;
    font: 14px/1.4 " helvetica="" neue",="" helvetica,="" arial,="" sans-serif;="" overflow:="" hidden;="" width:="" 840px;="" padding:="" 10px;="" background-color:="" white;"="">
        <div class="row">

            <div class="col-lg-12">
                <h4 style="background-color:cornflowerblue; padding:5px;">Educational information</h4>
            </div>
        </div>
        <div style="margin:10px;">
            <div class="row">
                <div class="col">

                    @Html.EditorFor(model => model.educations.Degree_Title, new { htmlAttributes = new { placeholder = "Enter Degree Title ", @class = "form-control" } })
                    @Html.ValidationMessageFor(model => model.educations.Degree_Title, "", new { @class = "text-danger" })

                </div>
                <div class="col">

                    @Html.EditorFor(model => model.educations.School, new { htmlAttributes = new { placeholder = "Enter School Name", @class = "form-control" } })
                    @Html.ValidationMessageFor(model => model.educations.School, "", new { @class = "text-danger" })

                </div>
            </div>
        </div>
        <div style="margin:10px;">
            <div class="row">
                <div class="col">

                    @Html.EditorFor(model => model.educations.Field_of_study, new { htmlAttributes = new { placeholder = "Enter Field of Study", @class = "form-control" } })
                    @Html.ValidationMessageFor(model => model.educations.Field_of_study, "", new { @class = "text-danger" })

                </div>
                <div class="col">

                    @Html.EditorFor(model => model.educations.Description, new { htmlAttributes = new { placeholder = "Enter Course/Degree Detail", @class = "form-control" } })
                    @Html.ValidationMessageFor(model => model.educations.Description, "", new { @class = "text-danger" })

                </div>
            </div>
        </div>

<div style="margin:10px;">
            <div class="row">
                <div class="col">

                    @Html.DropDownListFor(model=>model.educations.Grade, new List<SelectListItem>
  {
      new SelectListItem{ Text="Select Grade", Value = "1" },
      new SelectListItem{ Text="A", Value = "2" },
      new SelectListItem{ Text="B", Value = "3" },
           new SelectListItem{ Text="C", Value = "4" },
                new SelectListItem{ Text="D", Value = "5" },
                     new SelectListItem{ Text="E", Value = "6" },

   }, new { @class = "btn form-text" })
                    @Html.ValidationMessageFor(model => model.educations.Grade, "", new { @class = "text-danger" })

                    <div class="col-sm-4">
                        @Html.EditorFor(model => model.educations.Start_Year, new { htmlAttributes = new { placeholder = "Enter Start Date", @class = "form-control" } })
                        @Html.ValidationMessageFor(model => model.educations.Start_Year, "", new { @class = "text-danger" })

                    </div>
                    <div class="col-sm-4">
                        @Html.EditorFor(model => model.educations.End_Year, new { htmlAttributes = new { placeholder = "Enter End Date", @class = "form-control" } })
                        @Html.ValidationMessageFor(model => model.educations.End_Year, "", new { @class = "text-danger" })

                    </div>

                    <div class="col">


                        <label for="switch17">Active</label>
                        @Html.CheckBoxFor(m => m.educations.isFinalDegree, new { id = "switch17", name = "switch17", @class = "css-checkbox9 all_check" })

                    </div>

                </div>



            </div>
        </div>

    </div>

教育信息
@EditorFor(model=>model.educations.Degree_Title,new{htmlAttributes=new{placeholder=“Enter Degree Title”,@class=“form control”})
@Html.ValidationMessageFor(model=>model.educations.Degree_Title,“,new{@class=“text danger”})
@EditorFor(model=>model.educations.School,new{htmlAttributes=new{placeholder=“Enter School Name”,@class=“form control”})
@Html.ValidationMessageFor(model=>model.educations.School,“,new{@class=“text danger”})
@Html.EditorFor(model=>model.educations.Field_of_study,new{htmlAttributes=new{placeholder=“Enter Field of study”,@class=“form control”})
@Html.ValidationMessageFor(model=>model.educations.Field\u of_study,“,new{@class=“text danger”})
@Html.EditorFor(model=>model.educations.Description,new{htmlAttributes=new{placeholder=“Enter Course/Degree Detail”,@class=“form control”})
@Html.ValidationMessageFor(model=>model.educations.Description,“,new{@class=“text danger”})
@DropDownListFor(model=>model.educations.Grade,新列表
{
新建SelectListItem{Text=“Select Grade”,Value=“1”},
新建SelectListItem{Text=“A”,Value=“2”},
新建SelectListItem{Text=“B”,Value=“3”},
新建SelectListItem{Text=“C”,Value=“4”},
新建SelectListItem{Text=“D”,Value=“5”},
新建SelectListItem{Text=“E”,Value=“6”},
},新的{@class=“btn form text”})
@Html.ValidationMessageFor(model=>model.educations.Grade,“,new{@class=“text danger”})
@EditorFor(model=>model.educations.Start_Year,new{htmlAttributes=new{placeholder=“Enter Start Date”,@class=“form control”})
@Html.ValidationMessageFor(model=>model.educations.Start_Year,“,new{@class=“text danger”})
@EditorFor(model=>model.educations.End_Year,new{htmlAttributes=new{placeholder=“Enter End Date”,@class=“form control”})
@Html.ValidationMessageFor(model=>model.educations.End_Year,“,new{@class=“text danger”})
活跃的
@CheckBoxFor(m=>m.educations.isFinalDegree,新的{id=“switch17”,name=“switch17”,@class=“css-checkbox9 all_check”})

当我点击按钮时,它应该生成上述完整代码的次数与我点击按钮的次数相同

只需对其进行局部查看并在每次点击时加载如果我使用局部查看,那么我如何保存两个部分的数据,如正在出现的主教育表单+parview表单这两个数据表都需要保存到同一个表中