Guest User

Guest User

  • Tech Writer
  • 2.1k
  • 466.5k

checkbox to save values to the database

Nov 22 2021 10:58 AM

Hi Team

 

I have checkbox and want to save values to the local database,need help to create a controller method will save value to the database.

// View

<!--Checkbox for Application checklist-->

    @using(Html.BeginForm("Index", "Home", FormMethod.Post))
            {
<span>PLC_Marshal</span>@Html.CheckBox("PLC_Marshal", false)
            }

 

// Model

  public class Application_Checks
    {
        public bool PLC_Marshal { get; set; }

        public bool BVMS_PMON { get; set; }

        public bool FABS { get; set; }
    }

 

// Controller need help here to store values to the local database


Answers (1)