[CLOSED] Handling session for a EXT.NET Grid Panel ajax Call

  1. #1

    [CLOSED] Handling session for a EXT.NET Grid Panel ajax Call

    Hi Ext.NET Team,

    I have created a custom action filter for handling session expiration.
    Inside that filter I have checked whether session is null if yes i am redirecting it to the login page
    Below is the action filter code snippet:

     if (HttpContext.Session["PRUserDetails"] == null)
                    {                    
                       HttpContext.Response.Redirect("~/Account/LogOut");                                                                                                 
    
                        return;
    
                    }
    Issue is when i am placing that filter to an ajax call to load the grid panel.
    It do redirect to the login page but inside a window below is the method where i have placed the filter:

    [SessionExpireFilter]
            public StoreResult LoadGrid()
            {
    ...
    return this.Store(Model)
    }

    In the attachment the login page comes inside the window.

    Any suggestion on how to resolve this.


    Click image for larger version. 

Name:	login.jpg 
Views:	20 
Size:	84.7 KB 
ID:	6611
    Last edited by Daniil; Jul 25, 2013 at 5:57 AM. Reason: [CLOSED]
  2. #2
    Hi @PriceRightHTML5team,

    An AjaxProxy doesn't support a redirection response. You can listen its Exception (or a Store's Exception) event analyzing a response within a handler. If there is a redirection, then redirect the page client side via
    window.location = "new URL";
  3. #3
    Quote Originally Posted by Daniil View Post
    Hi @PriceRightHTML5team,

    An AjaxProxy doesn't support a redirection response. You can listen its Exception (or a Store's Exception) event analyzing a response within a handler. If there is a redirection, then redirect the page client side via
    window.location = "new URL";
    But how does the store's exception handler is raised.I added following code to the grid's store:

    X.Store().Listeners(l => l.Exception.Handler = "Error")
    and in my controller i am doing :

      public StoreResult GetList(string Id)
            {
                try
                {                
                    var dto = GetUserCredentials();
                    if (dto == null)
                    {
                        throw new Exception();
                    }
    }
    but the exception handler is not getting raised. Can you please provide a scenario on how to raise that handler
  4. #4
    Please try
    X.Store().Listeners(l => l.Exception.Handler = "Error()")
    or
    X.Store().Listeners(l => l.Exception.Fn= "Error")
    The difference between Fn and Handler is explained here.
    http://www.ext.net/2012/12/19/introd...xt-net-events/
  5. #5
    Quote Originally Posted by Daniil View Post
    Please try
    X.Store().Listeners(l => l.Exception.Handler = "Error()")
    or
    X.Store().Listeners(l => l.Exception.Fn= "Error")
    The difference between Fn and Handler is explained here.
    http://www.ext.net/2012/12/19/introd...xt-net-events/
    Thanks Daniil it worked

Similar Threads

  1. [CLOSED] Handling only Ajax Communication Errors
    By sbg in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Jul 13, 2012, 10:30 AM
  2. [CLOSED] Handling Un-Authenticated Ajax calls [401 Error]
    By webclouder in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Apr 22, 2011, 9:49 AM
  3. Replies: 2
    Last Post: Dec 28, 2010, 9:47 PM
  4. [CLOSED] Export Data From Grid Panel via AJAX with mask
    By anup in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: Sep 10, 2010, 7:31 AM
  5. [CLOSED] Ajax File Download - Handling an Error
    By rcaunt in forum 1.x Legacy Premium Help
    Replies: 14
    Last Post: Apr 12, 2010, 10:01 AM

Tags for this Thread

Posting Permissions