1. #1
    Ext JS Premium Member
    Join Date
    Aug 2009
    Posts
    112
    Vote Rating
    1
    Whatty is on a distinguished road

      0  

    Default Ext.Direct .NET Router and SessionManagement

    Ext.Direct .NET Router and SessionManagement


    Good afternoon,

    Is there a mechanism for session management in the Ext.Direct implementation or can anyone provide me with a strategy for handling session management in .NET.

    I was hoping for a similar mechanism that is found in the DirectJngine on the Java side but obviously for .NET.

    Alternatively, if this has already been handled if you could point me at that implementation it would be greatly appreciated.

    Thanks in advance.

  2. #2
    Ext JS Premium Member
    Join Date
    Aug 2009
    Posts
    112
    Vote Rating
    1
    Whatty is on a distinguished road

      0  

    Default


    Ignore, I found it finally in another post on the Ext.Direct impl for .NET

    FYI: In order to access the Session in Direct methods, your generic web handler needs to implement IRequiresSessionState or IReadOnlySessionState (for read only access).

    For example, your handler should look like:
    public class MyHandler: DirectHandler, IRequiresSessionState
    and then you can use something like the following in your classes

    Code:
            /// <summary>Retrieve an object from the session.</summary>
            /// 
            /// <param name="name">the name in of the object in the session.</param>
            /// 
            /// <returns>the session object</returns>
            /// 
            protected Object getSessionObject(String name) {
                Object sessionObject = null;
                HttpContext contextManager = HttpContext.Current;
                if (contextManager != null) {
                    HttpSessionState session = contextManager.Session;
                    if (session != null)
                    {
                        sessionObject = session[name];
                    }
                }
                return sessionObject;
            }
    
            /// <summary>Store an object in the session</summary>
            /// 
            /// <param name="name">the name in which to store the object under.</param>
            /// <param name="anObject">the object to store.</param>
            /// 
            protected void storeSessionObject(String name, Object anObject) {
                HttpContext contextManager = HttpContext.Current;
                if (contextManager != null) {
                    HttpSessionState session = contextManager.Session;
                    if (session != null)
                    {
                        session.Add(name, anObject);
                    }
                }
            }
    Assuming of course that you have dealt appropriately with the empty session issue, this should allow you to stuff and retrieve objects from the session.

    Whatty

  3. #3
    Sencha User
    Join Date
    Mar 2013
    Posts
    1
    Vote Rating
    0
    1414211340@qq.com is on a distinguished road

      0  

    Default 学习

    学习


    学习Ext.Direct

Thread Participants: 1

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi