Click here to Skip to main content
15,923,087 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
protected void Session_End(object sender, EventArgs e)
    {
        Application.Lock();
        Application["UsersOnline"] = (int)Application["UsersOnline"] - 1;
        Application.UnLock();
                 //// here I want my code to redirect to my home controler

    }




Please somebody help me regarding this.
Posted
Updated 11-Apr-14 2:09am
v2
Comments
Alok.singh1166 11-Apr-14 5:02am    
Please Somebody help me :(
Alok.singh1166 14-Apr-14 3:04am    
some body help me i need help

1 solution

Hi Alok,

You can try this code -

C#
protected void Application_Error()
       {
           var exception = Server.GetLastError();


           Response.Clear();
           Server.ClearError();

           var routeData = new RouteData();
           routeData.Values["controller"] = "Home";
           routeData.Values["action"] = "Index";
           Response.StatusCode = 500;

           IController controller = new HomeController();
           var rc = new RequestContext(new HttpContextWrapper(Context), routeData);
           controller.Execute(rc);
       }



Thanks,
Girijesh
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900