Node is saved as draft in My Content >> Draft
-
Using Radio Button and Checkbox in MVC
While making projects you need to use check boxes and radio button controls
So while making views you need to understand the way that these values are get or set
<div class="form-group" id="secondcountry" style="display:none">
<div class="col-md-10">
@foreach (var names in @Model.Country)
{
var checkBoxId = "radio" + names.Value;
var arr = Convert.ToString(@Model.getcountry);
if (names.Text == arr)
{
names.Selected = true;
}
var tdId = "td" + names.Value;
<table width="100%">
<tr>
<td width="20px">
<input type="radio" id="@checkBoxId" name="radioName" value="@names.Value" checked="@names.Selected" />
@*@Html.RadioButtonFor(m => m.value, @names.Value)*@
</td>
<td id="@tdId" width="100px">
@names.Text
</td>
</tr>
</table>
}
</div>
</div>
I have bind my model which contains list of countries into the check box with the help of for each loop
Same i have done with the radio button for displaying names that is checked from check box into the radio button
0 Comment(s)