I have a drop-down list with populated Ajax calls, now I have to select the value of the population and it's database table in the controller I have to store the verb method through these two answers to the stack overflow, and I try to provide the solution, but it does not work.
verb method:
public action classes (class C) {c.Course .title = request. [""]; C.ClassName = Request, ["classname"]; C.strength = Int16.Parse (Request ["strength"]); C.rollNoPattern = Request ["Roll Numbers"]; Db.Classes.Add (c); Db.SaveChanges (); Return Redirect Action ("Index"); }
Junkies:
& lt; Script & gt; $ (Document) .ready (function () {$ ('# b1'). Click (function () {var userName = "Hello" $ .getJSON ("/ classes / getCourseList? Username =" + userName, function (data1 ) {Var myOptions = {val1: data1.title}; var $ mySelect = $ ('# s1'); $ .eich (my option, function (val, text) {$ mySelect.append ($ ('$ (& lt; Option / & gt; ', {value: val, text: text}));})}});});}); & Lt; / Script & gt;
$ ("# b1"). $ ("Click" function (data) {$ ("" "" "" "" "" ("# dropdownId") empty (); $ ("# dropdownId") .andend ($ ("& lt; Gt; "). Val (" "). Text (" Please select category "); $., Function () {$ (" # dropdown id ") .andend ($ (" option & gt; ") Val (this.Value) .text (this.Text));});}}); Return to back;});
No comments:
Post a Comment