asp.net mvc - JQuery Dropdown change action in MVC5 -
I have a dropdown with two options that I ask for my model list, to move this dropdown option Want to use two scenes
Choice display is already a dropdown box if the data already exists. The second option displays a form to add a new record.
This view is
& lt; Div class = "row-fluid" & gt; & Lt; Div class = "control group offset 3" & gt; & Lt; Label = "text" class = "control-label" & gt; Select option & lt; / Label & gt; & Lt; Div class = "control" & gt; @ Html.DropDownListFor (model = & gt; model.ParentChoicesId, Model.ParentChoices, "- select the choice -", new {expected} "true", id = "choice", @class = "input-xlarge"} ) & Lt; / Div & gt; & Lt; / Div & gt; & Lt; Hour / & gt; & Lt; Div id = "result" & gt; & Lt; Div class = "row-fluid" id = "newparent" & gt; & Lt; Div class = "span6" & gt; & Lt; Div class = "control-group" & gt; & Lt; Label = "text" class = "control-label" & gt; Title & lt; / Label & gt; & Lt; Div class = "control" & gt; @ Html.DropDownListFor (model = & gt; model.pTitleId, Model.pTitle, "- select the title -", new {@class = "input-xlarge", required = "true"}) & lt; / Div & gt; & Lt; / Div & gt; & Lt; Div class = "control-group" & gt; & Lt; Label = "first name" category = "control-label" & gt; First name & lt; / Label & gt; & Lt; Div class = "control" & gt; @ Html.TextBoxFor (model = & gt; model.pFirstName, new {@class = "input-xlarge", required = "true"}) & lt; / Div & gt; & Lt; / Div & gt; ..... & lt; / Div & gt; & Lt; / Div & gt; & Lt; Div class = "span6" & gt; & Lt; Div class = "control-group" & gt; & Lt; Label = "text" class = "control-label" & gt; Nationality & lt; / Label & gt; & Lt; Div class = "control" & gt; @ Html.DropDownListFor (model => model.pCountryId, Model.pCountry, "- select country - new, {{essential =" true ", @ class =" input-excl. "}) & Lt; / Div & gt; & Lt; / Div & gt; ............... Model.ParentId, Model.Parents, "- Select parent - new, {@class =" input-xlarge ", required =" true "})
This controller is giving details of my options var parentChoice = GetParentChoice (). (T = & gt; New SelectListItem {Value = t.Value, Text = T. Test }); Model ParentChoices = parentChoice.Asumerable (); Public static IQueryable & lt; SelectListItem & gt; GetParentChoice () {var choiceList = New list & select Here is the jquery code
Comments
Post a Comment