@Html.RadioButtonFor(model => model.authType, “email”, Model.authType == “email”)Email
@Html.RadioButtonFor(model => model.authType, “sms”, Model.authType == “sms”)SMS
In the above radio button is auto checked based on condition Model.authType == “email” or Model.authType == “sms”, but i want to add two condition to auto check the radio button.
For example i tried to add condition like Model.authType == “email” && !string.IsNullOrEmpty(Model.email)
But second condition is not executed .and the checkbox is auto checking based on first condition and ignoring the second condition.
Its working fine fine , if i put only a single condition.
I trued below code but not working .
@Html.RadioButtonFor(model => model.authType, “email”, Model.authType == “email” && !string.IsNullOrEmpty(Model.email) )Email
@Html.RadioButtonFor(model => model.authType, “sms”, Model.authType == “sms” && !string.IsNullOrEmpty(Model.phone) )SMS
i also tried to assign both those condition in a single Boolean variable and used that variable but still not working.