If I have a single form - with two submits:
- From a save button - calls a form POST "Save" controller action.
- From a change of a dropdown list value - calls a form POST "NoSave" controller action that returns a modified view without saving.
What's the best way of achieving this?
At the moment, I have the following - but they both call the same POST controller action. I want to call a named action for the dropdownlist update.
<form form method="POST">
<!-- dropdown list -->
<div class="row">
@Html.LabelFor(x => x.FieldName, "Field Name:")
@Html.DropDownListFor(x => x.FieldName, Model.FieldName, new { @class = "browser-default", @onchange = @"form.submit();" })
@Html.ValidationMessageFor(x => x.FieldName)
</div>
</div>
<!-- save button-->
<div class="save-button">
<input type="submit" class="btn" value="Save" />
</div>
</form>