Dealing with CheckBoxList in Asp.net Mvc4 -


I want to implement a simple employee registration where employees enter their name and use their check box list Set select I problem when posting this data when the user clicks on the submit button, I am going to @ html.Checkbox with the input type = "checkbox" Instead of using it and I need to retrieve posts Details of the names and skill sets of employees Ddhti,

I was hoping to use the built-scene because I input type = "Czech box", but I'm not satisfied with it.

class

  public class employee {public string name {receipt; Set; } [Display (name = "select your skill")] Public IList & lt; String & gt; Proficiency Set; }} Public Sector SkillSet {Public Int ID {get; Set; } Public string skills {get; Set; } Public Child Selected {get; Set; }} Public Execution Register () {IEnumerable & lt; Skillset & gt; Langset = new list & lt; Skillset & gt; New Skillset {ID = 1, selected = true, Skill = "ASP.Net"}, New Skillset {ID = 2, Selected = False, Skill = "Java"}, New Skillset {ID = 3, Selected = False, Skill = "PHP"}, new skill set {id = 4, selected = wrong, skill = "jquery"}, new skill set {id = 5, selected = wrong, skill = "sql"}}; Employee employee = new employee (); ViewBagLanguage = langset; See Return (AMP); }  

HTML

  @ HTML.LabelFor (model => model.Name ) @ Html.EditorFor (model = & gt; model.Name) @ Html.DisplayNameFor (model => model proficiency) @Varach (Miscellaneous items in Ampseyil) {& lt; Input type = "checkbox" value = "@ item. Skill" name = "@model receipt" checked "=" @ item. Select "/>@item.Skill}" input type = "submit" value = "end" />  

Please provide a solution.

< / Div>


Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -