Radio button Use in MVC - B M SOLUTION
  • Radio button Use in MVC


     

     <div class="form-check-label">

           @Html.RadioButton("resStatus", "Current residing", true)&nbsp;@Html.Label("Current residing")

               </div>

           <div class="mb-3"></div>

           <div class="form-check-label">

        @Html.RadioButton("resStatus", "Flat is let out", false) &nbsp;@Html.Label("Flat is let out")

        </div>

      <div class="mb-3"></div>

         <div class="form-check-label">

         @Html.RadioButton("resStatus", "Flat is empty", false) &nbsp;@Html.Label("Flat is empty")

          </div>


    CS Code Given Below :- 

                 string rd1 = coll["resStatus"];

                  if (rd1 == "Current residing")

                        {

                            obj.CreatedBy = "Current residing";

                        }

                        else if (rd1 == "Flat is let out")

                        {

                            obj.CreatedBy = "Flat is let out";

                        }

                        else if (rd1 == "Flat is empty")

                        {

                            obj.CreatedBy = "Flat is empty";

                        }

                        else

                        {

                            obj.CreatedBy = "N/A";

                        }


  • You might also like

    No comments :

    Post a Comment