this is weird. I see references out there for @Html.Button() but when I type that Intellisense doesn't find such a helper... there's dropdownlist, hidden, editors, et cetera, but no button!
what's up with that?
this is weird. I see references out there for @Html.Button() but when I type that Intellisense doesn't find such a helper... there's dropdownlist, hidden, editors, et cetera, but no button!
what's up with that?
Razor does not appear to have a "Button" HTML helper. You're likely finding references to a custom-built HTML helper extension.
See here: http://www.asp.net/mvc/tutorials/creating-custom-html-helpers-cs
To expand on the accepted answer, so you can bind a submit button to a model property but have different text:
Using the following slightly modified
Button
helper class:There is no button helper as of mvc preview 3 (not mvc3)
it was mentioned a bunch in the past for example: http://blog.wekeroad.com/blog/aspnet-mvc-preview-using-the-mvc-ui-helpers/ however rolling your own is trivial - I have a basis for it somewhere around here I'll have to dig it up, but essentially just create a new Html.ButtonFor and copy the source code from Html.LabelFor and change the output to create an input type="button" tag.
MVC5 , Bootstrap ver 3.2.0
This will generate a link that looks like a button.