Html Helper not working, not recognizing InputModel inside RegistraModel

Oct 24, 2022
Reaction score
Hi. so im a beginneer at ASP.NET and have being trying to make a radio button for my fields using Html Helper because it is supposed to be the correct way of doing things in ASP.NET 6 so ive got inside InputModel a bool? for gender and an enum for proffesion, both also defined inside Areas.Identity.Data.ApplicationUser or in my case i called it Mindfull8User but in any case both dont work
@Html.RadioButtonFor(Input => Input.Gender)
i get an CS1061 error (register model does not have a definition for Gender)
and with
@Html.DropDownListFor(InputModel => InputModel.Input.UserProffesion.GetValues(typeof(Mindfull8User.Proffesion)).Cast<string>())
I get CS0176 Error (Member Enum.GetValues(Type) cannot be accessed with an isntance refrence; qualify it with a type name insted.
anyone can help? thanks


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question