Hi,
How can I call a controller method from a view on button click. I have been trying like below, but was no use.
<input type="button" value="Go Somewhere Else" onclick="location.href='<%: Url.Action('MyMethod', 'ControllerName', new { id = item.ID })'" />
Any help here please.
Thanks

Jiteendra SampathiraoRank #585 · 4.1K reputationPosted Jul 25, 2011, 9:43 PM EDT
use Html.Actionlink like...
<%: Html.ActionLink("Your_link", "Your_Method", "Your_ControllerName")%>
hope it help you....