views:

88

answers:

1

Opah!

Is there any way I can call a method in the controller through a javascript code? I am wanting to destroy a Session to leave a specific page.

Thanks!

+2  A: 

the simplest way to do this IMO is with javascript, calling

$.ajax(url: 'controller/action',success: function(data) { //do whatever with your result... }) 

you can also use $.get(), $.post()...

see jQuery - Ajax API for more.

moi_meme
It worked! Just put the link on a page edit hidden (Url.Action ()) and it worked. ThankSuccess
Ph.E