Skip to content

Maintain login in global.asax page

sudheer kumar

Asked Jul 10, 2014, 2:36 AM EDT2 answers
Share
LinkedInX
Using Global.asax to Check if User is Logged in When Each Page is Requested

2 Answers

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    # If it's webform then you can use Session_Onstart event inside Global.asax to check whether user is logged in or not
    # If it's MVC/Web API then you can create [Authorize] filter which you can include two ways:

    - Explicitly over any method of Controller, e.g.,

    [Authorize]

    Code
    public class ValueController
    {
    .....
    }


    and you can create Authorize filter and put over each controller class


    - The second way is to make this Authorize filter default for all controllers, which you can do by overriding the default one


    Hope this helps.


    twitter @sumitjolly

    0
  • 0
    In every web page based on session value checking weather user is log-in or not but insted of every page check it in gloabal.asax page
    0