Radio Button checked item should be true based on entry.isalbum value. Below is my View code..
@foreach(abc.Models.ddt entry in entrydetails)
{
@if(entry.isAlbum=="Album")
{
<input type="radio" id="c" name="isAlbum" checked="checked" value="Album" />
<label style="margin-right:10px" for="c"><span></span>Album</label>
}
<input type="radio" id="c1" name="isAlbum" value="Movies" />
<label style="margin-right:10px" for="c1"><span></span>Movies</label>
<input type="radio" id="c2" name="isAlbum" value="Single" />
<label style="margin-right:10px" for="c2"><span></span>Single</label>
</div>
}
}
foreach循环包含数据库中与专辑、电影或单曲对应的stroed值。
根据entry.isAlbum值,选中的单选按钮应为true。我们怎样才能做到这一点,请帮助我们?我在上面的代码中有三个单选按钮。根据输入,选中的单选按钮将为真。Isalbum vale。请帮帮我