So I wanted to see if anybody has done this...
I am trying to bind the click action, (hoping to do it without JavaScript, but not a world ender if I have to do it that way), of one of a group of buttons, to select some value, the same way you might use a Select list / Drop down list.
For instance, when I change the below MVC ViewModel bound DDL, it automatically updates the MySelectedValue when the form is submitted to the MVC Controller:
@Html.DropDownListFor(x => x.MySelectedValue, Model.MySelectList)
I want to do the same thing, only with buttons. The big thing here is, I do not want these buttons to submit the form, just change a value.
Note: The list of values that these buttons are bound will never get very long, and UI/UX direction is to have them as buttons.
<Button>ThisButton</Button>
<Button>ThatButton</Button>
<Button>ThatButton2</Button>
I've been digging, but just haven't found something that fit using the typicaly @Html.Button do something kinda thing, without submitting the form.
Any thoughts or guidance is appreciated, while I continue to dig for a solution myself. Thanks!