views:

64

answers:

1

if so, how should i pass the parameter? would a string matching the enum name be ok? This would be handy if I was passing a dropdown box that matched enumerated items.

It would be useful to use a solution presented in this answer if I could just as easily bind to the enum when I submit the data back.

A: 

Yes, when having a controller like:

enum MyAction { Lalala }

public ActionResult Index(MyAction action) { ... }

You can just do Index/Lalala, and everything works fine.

If you need more complex binding (like mapping a certain string value to a complex class), use something like StructureMap.

Jan Jongboom