May 12, 2016 my first podcast

Source: Internet
Author: User

1 usingSystem;2 usingSystem.Collections.Generic;3 usingSystem.Linq;4 usingsystem.web;5 usingSYSTEM.WEB.MVC;6 7 namespaceLizhugz. Areas.lizhuAdmin.Models8 {9      Public classFilterattribute:actionfilterattributeTen     { One         /*Filter A * Experience AOP programming Ideas - Result: View - Ation: Method the called with [FilterAttribute] - before the controller: all methods under this controller are verified - Before method: This method uses this validation -          */ +           Public stringMessage {Get;Set; } -  +         //executes after the action executes A          Public Override voidonactionexecuted (actionexecutedcontext filtercontext) at         { -             -             Base.   OnActionExecuted (Filtercontext);  -         } -  -         //execute before Action executes in          Public Override voidonactionexecuting (actionexecutingcontext filtercontext) -         { to             if(httpcontext.current.session["userId"]==NULL) +             { -                  theHttpContext.Current.Response.Redirect ("/lizhuadmin/ademinprodata/login"); *             } $             ElsePanax Notoginseng             { -HttpContext.Current.Response.Redirect ("/lizhuadmin/ademinprodata/index"); the             } +             A                  the                 Base. OnActionExecuting (filtercontext); +            -              $         } $  -         //executes after result is executed -          Public Override voidonresultexecuted (resultexecutedcontext filtercontext) the         { -             Base. Onresultexecuted (filtercontext);Wuyi         } the  -         //before result is executed Wu          Public Override voidonresultexecuting (resultexecutingcontext filtercontext) -         { About             Base.  Onresultexecuting (Filtercontext);  $         } -     } -  -  A      +}
View Code

May 12, 2016 my first podcast

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.