javascript code:
<script type="text/javascript">
function test(pa)
{
alert(pa);
}
</script>
index.cshtml
@using(Html.BeginForm("Index","Home"))
{
<button type="submit">Hello</button>
}
Controller
public class HomeController : Controller, IJavaScriptModelAware
{
//
// GET: /Home/
public ActionResult Index()
{
this.AddJavaScriptFunction("test", PageLoadEvent.Ready, null, "hello");
return View();
}
}
I am fallow javascript model
install this
Install-Package JSM.MVC4
what is problem i can't understand please solve this problem
Gaurpriya Bishnoi
06-Jul-2015greg DORIAN
03-Jul-2015