Multiple checkbox
-
Hi, I am working on ASP.NET MVC5. I have a two class that has many fields. In a different view, I want to insert two fields from on table and a list of one field from the other class. Table A CentreId AdminId (UserId) CentreName Address Phone Table B UserId FirstName LastName Email Password The view will have fields like below First Name Last Name Email Centres -------List the centres based on the UserId------- Button Save When the save button is clicked, I wish to add the details to another table like below Table C TeacherId AdminId CenterId How can I accomplish this? Please help Thanks
-
Hi, I am working on ASP.NET MVC5. I have a two class that has many fields. In a different view, I want to insert two fields from on table and a list of one field from the other class. Table A CentreId AdminId (UserId) CentreName Address Phone Table B UserId FirstName LastName Email Password The view will have fields like below First Name Last Name Email Centres -------List the centres based on the UserId------- Button Save When the save button is clicked, I wish to add the details to another table like below Table C TeacherId AdminId CenterId How can I accomplish this? Please help Thanks
And? What have you tried? Where are you stuck? What help do you need? And where does TeacherId come from?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay... AntiTwitter: @DalekDave is now a follower!
-
And? What have you tried? Where are you stuck? What help do you need? And where does TeacherId come from?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay... AntiTwitter: @DalekDave is now a follower!
Teacher is a new table and hence TeacherId. I added code in the Controller as below Public ActionResult Educator() { int curId = (int)Session["UserId"]; var centres = from c in db.Centres where c.AdminId == curId select c; return View(); } And in View, I have @html.Label("First Name") @Html.EditorFor() @html.Label("Last Name") @Html.EditorFor() @html.Label("Email") @Html.EditorFor() Next, I want a collection of Checkboxes from the Centres result. When I click submit, this record goes to the Users table and also the Teachers table. Thanks
-
Teacher is a new table and hence TeacherId. I added code in the Controller as below Public ActionResult Educator() { int curId = (int)Session["UserId"]; var centres = from c in db.Centres where c.AdminId == curId select c; return View(); } And in View, I have @html.Label("First Name") @Html.EditorFor() @html.Label("Last Name") @Html.EditorFor() @html.Label("Email") @Html.EditorFor() Next, I want a collection of Checkboxes from the Centres result. When I click submit, this record goes to the Users table and also the Teachers table. Thanks
sunsher wrote:
Next, I want a collection of Checkboxes from the Centres result.
I'd recommend reviewing the ng-loop directive. Most books will show how to do this in one of the first chapters.
Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^][](X-Clacks-Overhead: GNU Terry Pratchett)