Sreenath G

Sreenath G

  • NA
  • 233
  • 310.7k

How to call controller methods from view in MVC 3

Jul 25 2011 8:45 AM
 

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


Answers (1)