I’m not sure about this.
I have a dropdownlist that is filled with a collection in code behind. The values are numbers.
When I postback, do I need to check if those values are still numbers and they were not changed?
Or this is done automatically by the ASP.net runtime?
I’m trying to avoid any change by a malicious user.
Many thanks.
EnableEventValidation should take care of this for you. Here is the MSDN documentation: http://msdn.microsoft.com/en-us/library/system.web.ui.page.enableeventvalidation.aspx.
As StriplingWarrior mentioned, the viewstate could be tampered with which would, I believe, hinder the ability for the event validation feature to work. I would still check the the input yourself.