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 SampathiraoPosted Jul 26, 2011, 1:43 AM
use Html.Actionlink like...
<%: Html.ActionLink("Your_link", "Your_Method", "Your_ControllerName")%>
hope it help you....