Does ASP.NET contains any enumerator for common field names used in Request.Form collection such as “_EVENTTARGET” and “_EVENTARGUMENT”? I need to refer to those names in multiple places in my app and I would love to be able to type something like this.Page.Request[CommonRequestNames.EventTarget] instead of hard-coding them.
Does ASP.NET contains any enumerator for common field names used in Request.Form collection such
Share
There is nothing like this built into the BCL.
Instead of an enum consider using a set of public constant strings.
The reason enums are a poor choice is that they can only be based on integral types (except
Char), not strings and you would end up having to translate from enum value to enum name and back, which can get messy.