Skip to content
Loading
                  • @using (@Html.BeginForm("EditData", "Home", FormMethod.Post))
                    {
                    @Html.AntiForgeryToken();
                    @Html.HiddenFor(model=>model.Candidate_Id)
                    Application Entry
                     
                    Condidate's Name  
                    @Html.TextBoxFor(model => model.Name, new { @required = "required" })

                    Note 1:  [as per 10th certificate]
                    Note 2:  [Please do not use any prefix such as Mr. or Ms. etc.]
                    Father's Name
                    @Html.TextBoxFor(model => model.Father_Name, new { @required = "required" })
                    Recent Color Photograph
                    @Html.TextBoxFor(model => model.Photograph, new { @type = "file", @id = "photograph", @onchange = "showimagepreview(this)", @class = "form-control" })
                    @if ((Model.Photograph) != null)
                    {
                     brand image
                    }
                    Condidate's Signature
                    @Html.TextBoxFor(model => model.Candidate_signature, new { @type = "file", @id = "candi_sign", @onchange = "showimagepreviews(this)", @class = "form-control" })
                    @if ((Model.Candidate_signature) != null)
                    {
                     brand image1
                    }
                    Gender
                    @Html.DropDownListFor(model => model.Gender,
                    new List
                    {
                    new SelectListItem{Value="Male",Text="Male"},
                    new SelectListItem{Value="Female",Text="Female"},
                    }, new { @class = "span6" })
                    Date Of Birth
                    @Html.TextBoxFor(model => model.DOB, new { @id = "datepicker", @type = "date" })
                    Note 1:  [Date of Birth as recorded in the Matriculation/Secondary Certificate]
                    Select Course
                    @Html.DropDownListFor(model => model.course,
                    new List
                    {
                    new SelectListItem{Value="0",Text="Select"},
                    new SelectListItem{Value="1",Text="MBA"},
                    new SelectListItem{Value="2",Text="B.TECH"},
                    new SelectListItem{Value="3",Text="POLYTECHNIC"}
                    }, new { @class = "span6", @onchange = "SelectedIndexChanged()" })
                    @*@Html.DropDownList("AddData", ViewData["course"] as List)*@


                    IF You Are Appearing Condidate
                    @Html.DropDownListFor(model => model.appearing_class,
                    new List
                    {
                    new SelectListItem{Value="0",Text="select"},
                    }, new { @class = "span6", @id = "AppearingClass", @name = "AppearingClass" })
                    @**@

                    Educational Qualification

                    A. % of Class 10th
                    @Html.TextBoxFor(model => model.highschool, new { @class = "span6", @id = "10textbox", @name = "highschooltextbox", }) %
                         Passing Year of Class 10th
                    @Html.DropDownListFor(model => model.Passing_Year_10,
                    new List
                    {
                    new SelectListItem{Value="2010",Text="2010"},
                    new SelectListItem{Value="2011",Text="2011"},
                    }, new { @class = "span6", @id = "dropdown10", @name = "highschooldropdown" })
                    B. % of Class 12th
                    @Html.TextBoxFor(model => model.Intermediate, new { @id = "12textbox", @name = "intermediatetextbox" }) %
                         Passing Year of Class 12th
                    @Html.DropDownListFor(model => model.Passing_Year_12,
                    new List
                    {
                    new SelectListItem{Value="2010",Text="2010"},
                    new SelectListItem{Value="2012",Text="2012"},
                    }, new { @class = "span6", @id = "12dropdown", @name = "intermediatedropdown" })
                    C. % of Graduation
                    @Html.TextBoxFor(model => model.Graduation, new { @id = "grad", @name = "gradtextbox" }) 
                         Passing Year of Graduation
                    @Html.DropDownListFor(model => model.Passing_Year_Grad,
                    new List
                    {
                    new SelectListItem{Value="2010",Text="2010"},
                    new SelectListItem{Value="2011",Text="2011"},
                    }, new { @class = "span6", @id = "graddropdown", @name = "graduationdropdown" })
                    Condidate's Contact No 1.
                    @Html.TextBoxFor(model => model.Contact_No1)
                    Condidate's Contact No 2.
                    @Html.TextBoxFor(model => model.Contact_No2)
                    Condidate's Email-ID
                    @Html.TextBoxFor(model => model.Email_Id)
                    Place Of Residence
                    @Html.DropDownListFor(model => model.Residence,
                    new List
                    {
                    new SelectListItem{Value="Village",Text="Village"},
                    new SelectListItem{Value="Town",Text="Town"},
                    })
                    Choice Of Exam Centre code
                    1.  Choice @Html.TextBoxFor(model => model.Exam_center_code)
                    Category
                    @Html.DropDownListFor(model => model.Category,
                    new List
                    {
                    new SelectListItem{Value="GEN",Text="GEN"},
                    new SelectListItem{Value="OBC",Text="OBC"},
                    new SelectListItem {Value="SC", Text = "SC" },
                    new SelectListItem{Value="ST",Text="ST"},
                    })
                    Occupation Of Parent / Guardian
                    @Html.DropDownListFor(model => model.Occupation_father,
                    new List
                    {
                    new SelectListItem{Value="Aggriculture",Text="Aggriculture"},
                    new SelectListItem{Value="Bussiness",Text="Bussiness"},
                    new SelectListItem {Value="Private", Text = "Private" },
                    })
                    Total Annual Income Of Parent / Guardian
                    @Html.DropDownListFor(model => model.Income,
                    new List
                    {
                    new SelectListItem{Value="1,00,000",Text="1,00,000"},
                    new SelectListItem{Value="1,00,000-3,00,000",Text="1,00,000-3,00,000"},
                    new SelectListItem {Value="3,00,000 - 6,00,000", Text = "3,00,000 - 6,00,000" },
                    new SelectListItem {Value="Above 10,00,000", Text = "Above 10,00,000" },
                    })
                    District / City
                    @Html.TextBoxFor(model => model.City)
                    State
                    @Html.TextBoxFor(model => model.State)
                    Condidate's Mailing Address 1
                    @Html.TextBoxFor(model => model.Mail_Id1)
                    Condidate's Mailing Address 2
                    @Html.TextBoxFor(model => model.Mail_Id2)

                    Declaration

                    I hereby declare that all the particulars stated in the application form are true to the best of my knowledge and belief. I have read the MSJEE Information Brochure and I shall abide by the terms & condition their in.

                    I agree with all condition.


                    }
                    Copyright © 2014, comed-i. All Rights Reserved.
                    0
                  • Ramesh Palanivel
                    0
                    Hi Indu,
                     
                    In your Ajax Posting , you are only posting the Id value, behind the reason your Model is Empty,It will only post the Id value to your second parameter. Your model will not bind here. For that, you can use form.serialize method.. Try my code, I have posted here
                     
                     
                    function SelectedIndexChanged() {
                    $("#AppearingClass").empty();
                    $.ajax({
                    type: 'POST',
                    url: '@Url.Action("GetClass")',
                    dataType: 'json',
                    data: { Candidate_Id: $("#course").val() },
                    success: function (data) {
                    $("#AppearingClass").append('');
                    for (var i = 0; i < data.length; i++)
                    { var opt = new Option(data[i].Text, data[i].Value); $('#AppearingClass').append(opt); }
                    $("#div10").hide();
                    $("#drop10").hide();
                    },
                    error: function (ex) {
                    alert('Failed to retrieve states.' + ex);
                    }
                    });
                    }
                     
                    Tryt the below code,
                    1. function SelectedIndexChanged() {  
                    2. $("#AppearingClass").empty();  
                    3. $.ajax({  
                    4. type: 'POST',  
                    5. url: '@Url.Action("GetClass")',  
                    6. dataType: 'json',  
                    7. data: $('#EditData').Serialize(),  
                    8. success: function (data) {  
                    9. $("#AppearingClass").append('<option value="0">Selectoption>');  
                    10. for (var i = 0; i < data.length; i++)  
                    11. { var opt = new Option(data[i].Text, data[i].Value); $('#AppearingClass').append(opt); }  
                    12. $("#div10").hide();  
                    13. $("#drop10").hide();  
                    14. },  
                    15. error: function (ex) {  
                    16. alert('Failed to retrieve states.' + ex);  
                    17. }  
                    18. });  
                    19. }  
                    0
                  • 0
                    sir please check it again ...............because it is not updating 
                    [HttpGet]
                    public ActionResult EditData(int Candidate_Id)
                    {
                    var x = (from c in context.Applications where c.Candidate_Id == Candidate_Id select c).FirstOrDefault();
                    Application pro = new Models.Application();
                    pro.Candidate_Id = x.Candidate_Id;
                    pro.Name = x.Name;
                    pro.Father_Name = x.Father_Name;
                    pro.Photograph = x.Photograph;
                    pro.Candidate_signature = x.Candidate_signature;
                    pro.Gender = x.Gender;
                    pro.Gender = x.Gender;
                    pro.DOB = x.DOB;
                    pro.course = x.course;
                    pro.appearing_class = x.appearing_class;
                    pro.highschool = x.highschool;
                    pro.Passing_Year_10 = x.Passing_Year_10;
                    pro.Intermediate = x.Intermediate;
                    pro.Passing_Year_12 = x.Passing_Year_12;
                    pro.Graduation = x.Graduation;
                    pro.Contact_No1 = x.Contact_No1;
                    pro.Contact_No2 = x.Contact_No2;
                    pro.Email_Id = x.Email_Id;
                    pro.Residence = x.Residence;
                    pro.Exam_center_code = x.Exam_center_code;
                    pro.Category = x.Category;
                    pro.Occupation_father = x.Occupation_father;
                    pro.Income = x.Income;
                    pro.City = x.City;
                    pro.State = x.State;
                    pro.Mail_Id1 = x.Mail_Id1;
                    pro.Mail_Id2 = x.Mail_Id2;
                    ViewBag.id = x.Candidate_Id;
                    return View(pro);
                    }
                    [HttpPost]
                    [ValidateInput(false)]
                    public ActionResult EditData(Application pro)
                    {
                    if (ModelState.IsValid)
                    {
                    context.Entry(pro).State = EntityState.Modified;
                    context.SaveChanges();
                    return RedirectToAction("Index", "Home");
                    }
                    return View(pro);
                    }
                    [HttpGet]
                    public ActionResult DeleteData(int Candidate_Id)
                    {
                    return View();
                    }
                     
                    0
                  • 0
                    sir when post the value then image is not updating while in [HttpGet] Image has some value
                    0