views:

8134

answers:

4

Starting from ASP.NET MVC Preview 3, HTML.Button ( and other related HTML controls) are no longer supported.

The question is, what is the equivalent for them? I've an app that was built using Preview 2, now I have to make it compatible with the latest CTP releases.

+6  A: 

Just write <input type="button" ... /> to your html. There's nothing special at all with the html controls.

Joel Coehoorn
look at http://stackoverflow.com/questions/407770/mapping-individual-buttons-on-asp-net-mvc-view-to-controller-actions
Junior Mayhé
A: 

<asp:Button> is the ASP.NET equivalent to the HTML.Button. It will by default generate an <input type="button">. (This is the System.Web.UI.WebControls.Button class)

Thunder3
+1  A: 

I got it figure out. It goes something like this:

<form method="post" action="<%= Html.AttributeEncode(Url.Action("CastUpVote")) %>">
<input type="submit" value="<%=ViewData.Model.UpVotes%> up votes" />
</form>

Thanks everyone for their help!

Ngu Soon Hui
+1  A: 

Several of the extension methods got moved to Microsoft.Web.Mvc, which is the MVC Futures DLL. You might want to look there for things that have gone missing.

Brad Wilson