Instead of a grid with an ‘Edit’ link in each row, I’d like to use a drop down list and a single ‘Edit’ button. What’s the cleanest way to make that button direct to /Edit/{id}(i.e. the ddl selected value)? Using onclick with window.location is way too ugly, super ugly if I have to account for the url base being http://approot/ or http://approot/controllername/ since it’s on the Index view.
Share
You can use any kind of form presentation, you just have to make sure the name of the value you’re submitting matches the type and name what the controller is expecting.
For example on the page:
and then the controller that the form is talking to should look something like:
then whatever option was selected will pass its value to the controller, as long as the names match and the form’s action is the correct controller action