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!

1 Answer 1

7

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.

Sign up to request clarification or add additional context in comments.

1 Comment

It worked! Just put the link on a page edit hidden (Url.Action ()) and it worked. Thank Success

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.