i have created lots of different Views for Post data to the Database.I want to use a common View that will replace all the differnt views. This will save a lot of time and coding burdon.

<div class="modal-dialog">
    <div class="modal-content">
   @using (Ajax.BeginForm("AddStudent", "Student", new AjaxOptions() 
   { 
       InsertionMode = InsertionMode.Replace,
       UpdateTargetId = "dvStudent",
       OnSuccess = "$('#dvStudentAdd').modal('hide');BindStudent();"
       //OnComplete = "onComplete();"
   }))
   {
                        <div class="modal-header">
                           <button type="button" class="close" data-dismiss="modal">
                    <span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                            <h4 id="H7" class="modal-title text-left">
                                <span id="StudentHeader"></span></h4>
                        </div>
                        <div class="modal-body">
                            <div class="grid-body no-border">
                                <div class="row">
                                    <div class="col-md-12">
                                         <table class="table table-bordered">

                <tr>
                    <td>
                        Enter Student Name:
                    </td>
                    <td>
                        @Html.HiddenFor(model => model.Id)
                        @Html.TextBoxFor(model => model.Student)<br/>
                        @Html.ValidationMessageFor(model => model.Student)
                    </td>
                </tr>
                <tr>
                    <td>
                        Status:
                    </td>
                    <td align="left">
                          @Html.CheckBox("Status", Model.Status.IsNull() ? false : Model.Status.Value)
                          &nbsp;<span>Active</span>
                    </td>
                </tr>
            </table>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="modal-footer">
                                 <input type="submit" value="Save" class="btn btn-primary" onclick="BindStudent();"/>
                <button data-dismiss="modal" class="btn btn-default">
                    <i class="icon-cancel-circle"></i>Close</button>
                        </div>
   }
</div>
</div>

This is one of them partial view. i want to make this as a Generic Partial View which will work for all.

Related posts

Recent Viewed