Application of the MVC member logout function cookie

Source: Internet
Author: User

We have implemented the "MVC Application Implementation Member login function" Http://www.cnblogs.com/insus/p/3466512.html login will have logout function.
This insus.net exercises an MVC application logoff feature.

Open MemberController.cs, add a Jsonresult ():

In the views/member/default.cshtml view, add a form and write an ammonium button:



Now we can write an ammonium button for the jquery logoff event:


Countless post, #15行的data设为null, because after the controller has processed the cookie expires, there are set view-oriented, so #19 line code, the guidance is assigned to the HREF.

Here's a real-time walkthrough (if you don't see the animation, refresh the page):

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.