I have a problem for which I just can't find a solution.
Checking button like this works:
@Html.RadioButtonFor(x => x.an2[0], 3, Model.an2[0]==3
? new { id = "B", @checked = "checked" } : null)
But I also need to set id, how do I do that? This code:
@Html.RadioButtonFor(x => x.an2[0], 3, Model.an2[0]==3
? new { id = "B", @checked = "checked" } : new { id = "B" })
Gives error:
Type of conditional expression cannot be determined because there is no implicit conversion between 'AnonymousType#1' and 'AnonymousType#2'
Which is beyond my understanding.
I suppose there should be a trivial solution to this?