MVC Sample Code

How to create a button that will call a controller action and pass in parameters:

<input id=”EditButton” value=”Edit” type=”button” onclick=”window.location.href = ‘@Url.Action(“action”, “controller”, new { id = 1 })‘” />

Advertisements