Hello Priya Darshan,
It is a obvious fail attempt to call a server method through client side element.
You are using client side html elements as list which is a
<li>
element, so you have to call a client-side method only in JavaScript.
In your case you can call this page method in JavaScript making a ajax call (check with jquery
.ajax()
method.), then call that method in the list item click.
OR else you can create a web method to be called through JavaScript, then call that method in the list item click.
Again to add click event handler to li element add a ID to that element let say 'liTest', now add the click event as below :-
$('#liTest').on('click', function(){
Logout();
});
Reference : -
http://api.jquery.com/jquery.ajax/[
^]
[
^]
Hope you will have some idea by referring this explanation.