According to an answer here, I can prevent a button from submitting the form by setting its type value to "Button", like so in HTML:
<button type="button">Cancel changes</button>
...but how can I do this in C#? I am creating my controls dynamically, something like this (pseudocode, as I'm away from my IDE):
button btn = new Button
{
CSS = "bla"
}
btn.Type = "Button"; // <- something like this?
Use HtmlButton instead of Button if you want the "HTML button tag"
Button renders
<input type="submit" />
and Button.UseSubmitBehavior renders<input type="button" />
.HtmlButton will render
<button type="YOUR_DEFINITION"></button>
.