ASP.NET - Get selected value from Dropdownlist on my Controller

0

I have a dropdownlist that is defined in my view as follows:

 @Html.DropDownList("Exame", ViewBag.Exame as SelectList, "Escolha uma
 opção...", new { @class = "form-control", @name="ExameARegistar" })

This dropdownlist should allow a registered user to enroll in an exam from a list. For this, I will need to get the value selected from my controller.

I tried to use Request.Form["ExameARegistar"] but it always returns null. I would like to realize what is causing this error. If not, I would like to know if there is a better alternative to Request.Form ...

    
asked by anonymous 19.08.2018 / 23:01

1 answer

-1

I ended up bypassing this problem using a hidden variable: link

    
20.08.2018 / 13:03