Click here to Skip to main content
15,887,428 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Can any body help me to save multiple check box value with a input text box into db using C# blazor? my code something like this:

What I have tried:

<pre><div class="form-row">
  @foreach (var lstitem in @testpt.PTList) {
  <div class="col-md-3 mb-3">
    <div class="form-check">
      <InputCheckbox class="form-check-input" @bind-Value="@lstitem.PtSelected" /> @lstitem.PtName<br />
    </div>
  </div>
  <div class="col-md-8 mb-3">
    <label for="testname" class="control-label">Limit</label>
    <InputNumber for="testname" class="form-control" id="testname" placeholder="Test name" @bind-Value="@lstitem.PtLimit" />
  </div>
  }
</div>


main clas:
public class TestBenchIntilization
{
[Required]
public int TestId { get; set; }

public TestBenchPressureTransducer Solenoid { get; set; } = new TestBenchPressureTransducer();

sub class:
public class TestBenchPressureTransducer
{
    public int  TestId { get; set; }
    public DateTime TestDate { get; set; }
    public string PtName { get; set; }
    public bool PtSelected{ get; set; }
        public float PtLimit { get; set; }
}

}
Posted
Comments
[no name] 10-Sep-20 14:11pm    
Try reading "a" checkbox; then get back to us when you got that working.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900