[CLOSED] Problem load Page in Panel

  1. #1

    [CLOSED] Problem load Page in Panel

    Hi

    For continue with this problem, I played with the Session and Form timeouts without solution. Furthermore, I don't receive DirectMethod, Loader or Ajax exception messages (all with handlers). Using Fiddler, I have the next headers when the Container page requests the content for the pnlContent:




    Request:
    POST /Pages/Locations/Search.aspx?_dc=1399327754846 HTTP/1.1
    Host: host.com
    Proxy-Connection: keep-alive
    Content-Length: 978
    Proxy-Authorization: Basic cmljYXJkby5oZXJuYW5kZXo6MTIzNDU2
    X-Ext-Net: delta=true
    Origin: http://host.com
    X-Requested-With: XMLHttpRequest
    User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.131 Safari/537.36
    Content-Type: application/x-www-form-urlencoded; charset=UTF-8
    Accept: */*
    Referer: http://host.com/Pages/Locations/Sear...=1399327754846
    Accept-Encoding: gzip,deflate,sdch
    Accept-Language: es-ES,es;q=0.8,en;q=0.6,gl;q=0.4,pt;q=0.2
    Cookie: ASP.NET_SessionId=hk2zvaet4wzfiue12j032o1z; .ASPNET_WAM=55A22F5435D18F37B7158892070918E62382CEB6018427AD69133C11CC227C1D41C6CC3ECDBF9BC4D6444F051DFFC7A26C31CFB0ABECDB05951270BAB6F9829AFB6A6AF859BCD0E3AF45C78E65C3734228EEF72A42885F0646F0815BDC39F957374406FCB65F1A3B945C9FB5BB248A2A6ECAAB2A8143697FF74ECC33921D2E00A17C9E15F5FEA5FD65B3A88C1A27BD33

    Response:
    HTTP/1.1 200 OK
    Cache-Control: private
    Content-Type: text/html; charset=utf-8
    Location: /Default.aspx?ReturnUrl=%2fPages%2fLocations%2fSearch.aspx%3f_dc%3d1399327754846&_dc=1399327754846
    Server: Microsoft-IIS/8.5
    X-AspNet-Version: 4.0.30319
    X-Powered-By: ASP.NET
    Date: Mon, 05 May 2014 22:08:40 GMT
    Content-Length: 132
    X-Cache: MISS from (external)proxy.com.co
    X-Cache-Lookup: MISS from (external)proxy.com.co:3130
    X-Cache: MISS from (frontal)proxy.com.co
    X-Cache-Lookup: MISS from (frontal)proxy.com.co:3128
    Via: 1.1 (external)proxy.com.co (squid/3.3.8), 1.1 (frontal)proxy.com.co (squid/3.3.8)
    Connection: keep-alive
    Response Textview:
    {"script":"window.location=\"/Default.aspx?ReturnUrl=%2fPages%2fLocations%2fSearch.aspx%3f_dc%3d1399327754846&_dc=1399327754846\";"}



    And then, the browser redirects to the login page. The response Textview is showed in the Request Failure message because it hoped a Json string for load one grid:



    I tried reloading the Container page changing the loaded page in the Container's load event but I received the HTTP 302 code and the browser redirects to the login page too.

    I have a IIS 8.5, VS 2010 with framework 4.0

    Please, I need to resolve this problem urgently. Otherwise, how can I implement this navigation type without problems?

    Regards
    Attached Thumbnails Click image for larger version. 

Name:	Request Failure.png 
Views:	109 
Size:	7.2 KB 
ID:	10451  
    Last edited by Daniil; May 20, 2014 at 7:54 AM. Reason: Please use [CODE] tags, [CLOSED]
  2. #2
    Hi @,

    Furthermore, I don't receive DirectMethod, Loader or Ajax exception messages (all with handlers).
    Please demonstrate how did you try? And what exactly request does cause that redirection?

    And then, the browser redirects to the login page.
    I am afraid we cannot add anything to what we already said in the previous thread that you mentioned. Maybe, this can help:
    http://stackoverflow.com/questions/8...eing-restarted
  3. #3
    Hi again

    I have the next code for error handling:

    
    var catchAjaxException = function (response, result, el, eventType, action, extraParams, o) {
         alert('catchAjaxException');
         result.success = true;
         result.errorMessage = "";
         o.cancelFailureWarning = true;
         return true;
    }
    
    
    Ext.Ajax.on('requestexception', function (conn, response, options) {
        alert('requestexception');
        console.log(response);
    });
    
    
    <ext:ResourceManager runat="server" Theme="Gray" DirectMethodNamespace="SIU.DirectMethods" >
            <Listeners>
                <AjaxRequestException Fn="catchAjaxException" />
            </Listeners>
    </ext:ResourceManager>
    In the pnlContent panel:

    <ext:Panel ID="pnlContent" runat="server" Margins="5" Region="Center" BodyPadding="13">
         <Loader runat="server" Mode="Frame" AutoLoad="false" ShowWarningOnFailure="false">
             <LoadMask ShowMask="true" />
         </Loader>
    </ext:Panel>
    There isn't difference if ShowWarningOnFailure="true". Additionally, I have error handling in every method on the application and in Application_Error at the Global.asax level.

    The request that causes the redirection is:

    
            // Cargar contenido en el pnlContent
            var jsLoadPageMenu = function (reqPage, idObj) {
                SIU.DirectMethods.LoadPageMenu(reqPage, idObj);
            };
    
           <ext:Panel ID="pnlMenuObjects" runat="server" Title="<%$Resources:GeneralResource, GeneralObjects %>"
                   IconPath="/Images/ic_objects.png" BodyPadding="6">
                   <Content>
                        <table width="100%" class="tableMenuContainer">
                            ...
                        </table>
                   </Content>
                   <Listeners>
                          <Expand Handler="jsLoadPageMenu('Object', '');" />
                   </Listeners>
           </ext:Panel>
    
    
            [DirectMethod]
            public void LoadPageMenu(string reqPage, string idObj = "")
            {
                try
                {
                    switch (reqPage)
                    {
                        case "User":
                            pnlContent.Loader.Url = "/Pages/Users/Search.aspx";
                            break;
                        case "UserEdit":
                            if ((idObj == "") || (idObj == null))
                                pnlContent.Loader.Url = "/Pages/Users/AddEdit.aspx";
                            else
                                pnlContent.Loader.Url = "/Pages/Users/AddEdit.aspx?EditId=" + idObj;
    
                            break;
                        case "Company":
                            pnlContent.Loader.Url = "/Pages/Companies/Search.aspx";
                            break;
                        case "CompanyEdit":
                            if ((idObj == "") || (idObj == null))
                                pnlContent.Loader.Url = "/Pages/Companies/AddEdit.aspx";
                            else
                                pnlContent.Loader.Url = "/Pages/Companies/AddEdit.aspx?EditId=" + idObj;
    
                            break;
                        case "Location":
                            pnlContent.Loader.Url = "/Pages/Locations/Search.aspx";
                            break;
                        case "LocationEdit":
                            if ((idObj == "") || (idObj == null))
                                pnlContent.Loader.Url = "/Pages/Locations/AddEdit.aspx";
                            else
                                pnlContent.Loader.Url = "/Pages/Locations/AddEdit.aspx?EditId=" + idObj;
                            break;
                        case "LocationObject":
                            pnlContent.Loader.Url = "/Pages/Locations/LocationObjects.aspx?EditId=" + idObj;
                            break;
                        case "Object":
                            pnlContent.Loader.Url = "/Pages/Objects/Search.aspx";
                            break;
                        case "ObjectEdit":
                            if ((idObj == "") || (idObj == null))
                                pnlContent.Loader.Url = "/Pages/Objects/AddEdit.aspx";
                            else
                                pnlContent.Loader.Url = "/Pages/Objects/AddEdit.aspx?EditId=" + idObj;
                            break;
                        case "HistoricalData":
                            pnlContent.Loader.Url = "/Pages/Objects/HistoricalData.aspx?EditId=" + idObj;
                            break;
                        case "Report":
                            pnlContent.Loader.Url = "/Pages/Users/Search.aspx";
                            break;
                        default:
                            pnlContent.Loader.Url = "/Pages/Users/Search.aspx";
                            break;
                    }
    
                    pnlContent.LoadContent();
                }
                catch (Exception ex)
                {
                    ManageError(ex, "LoadPageContent");
                }
            }
    It throws error with this procedure or when the page loads in the pnlContent panel, at the moment of load the grid data (in the page load event):

    
        <ext:GridPanel runat="server" ID="grdData" Title="<%$Resources:GeneralResource, GeneralLocations %>"
            MinHeight="300" >
            <Store>
                <ext:Store ID="grdDataStore" runat="server" PageSize="10" OnReadData="grdDataStore_ReadData">
                    <Model>
                        <ext:Model ID="grdDataModel" runat="server" IDProperty="LocationId">
                            <Fields>
                                <ext:ModelField Name="LocationName" />
                                <ext:ModelField Name="LocationType">
                                    <Model>
                                        <ext:Model ID="Model2" runat="server">
                                            <Fields>
                                                <ext:ModelField Name="LocationTypeName" />
                                            </Fields>
                                        </ext:Model>
                                    </Model>
                                </ext:ModelField>
                                <ext:ModelField Name="Latitude" Type="Float" />
                                <ext:ModelField Name="Longitude" Type="Float" />
                                <ext:ModelField Name="Company">
                                    <Model>
                                        <ext:Model ID="Model3" runat="server">
                                            <Fields>
                                                <ext:ModelField Name="Name" />
                                            </Fields>
                                        </ext:Model>
                                    </Model>
                                </ext:ModelField>
                            </Fields>
                        </ext:Model>
                    </Model>
                    <Proxy>
                        <ext:PageProxy />
                    </Proxy>
                </ext:Store>
            </Store>
            <ColumnModel ID="comGrdData" runat="server">
                <Columns>
                    <ext:Column ID="Column1" runat="server" Text="<%$Resources:GeneralResource, GeneralLocation %>"
                        DataIndex="LocationName" Flex="2" />
                    <ext:Column ID="Column2" runat="server" Text="<%$Resources:GeneralResource, GeneralLocationType %>"
                        DataIndex="LocationType" Flex="1">
                        <Renderer Handler="return value.LocationTypeName;" />
                    </ext:Column>
                    <ext:Column ID="Column3" runat="server" Text="<%$Resources:GeneralResource, GeneralCompany %>"
                        DataIndex="Company" Flex="2">
                        <Renderer Handler="return value.Name;" />
                    </ext:Column>
                    <ext:CommandColumn ID="cmdMapView" runat="server" Flex="1">
                        <Commands>
                            <ext:GridCommand Icon="Map" CommandName="MapView">
                                <ToolTip Text="<%$Resources:GeneralResource, GeneralMapView %>" />
                            </ext:GridCommand>
                            <ext:GridCommand Icon="MapGo" CommandName="LocObject">
                                <ToolTip Text="<%$Resources:GeneralResource, GeneralLocationObjects %>" />
                            </ext:GridCommand>
                            <ext:GridCommand Icon="NoteEdit" CommandName="Edit">
                                <ToolTip Text="<%$Resources:GeneralResource, GeneralEdit %>" />
                            </ext:GridCommand>
                        </Commands>
                        <Listeners>
                            <Command Fn="jsGridCommand" />
                        </Listeners>
                    </ext:CommandColumn>
                </Columns>
            </ColumnModel>
            <BottomBar>
                <ext:PagingToolbar ID="pagTool" runat="server" DisplayInfo="true" DisplayMsg="<%$Resources:GeneralResource, GeneralPagToolMsg %>"
                    EmptyMsg="<%$Resources:GeneralResource, GeneralPagToolEmpty %>" />
            </BottomBar>
        </ext:GridPanel>
    
    
            protected void grdDataStore_ReadData(object sender, StoreReadDataEventArgs e)
            {
                try
                {
                    int start = e.Start;
                    int limit = e.Limit;
                    int totRegisters;
    
                    int idComp;
                    if (!int.TryParse(sebCompany.SelectedItem.Value, out idComp))
                        idComp = 0;
    
                    int idLocT;
                    if (!int.TryParse(sebLocationType.SelectedItem.Value, out idLocT))
                        idLocT = 0;
    
                    List<Location> objData = LogicInterface.FindLocations(txtLocation.Text, idLocT, idComp, start, limit, out totRegisters);
                    Paging<Location> objDataPaging = new Paging<Location>(objData, totRegisters);
    
                    e.Total = totRegisters;
                    grdDataStore.DataSource = objDataPaging.Data;
                    grdDataStore.DataBind();
                }
                catch (Exception ex)
                {
                    ManageError(ex, "grdDaraStore_ReadData");
                }
            }
    The data conexion is fine. The data cookies too (I can see them in the fiddler, firebug and Chrome's tools). The problem presents in all browsers.

    Thanks
  4. #4
    I forgot to say that in development with Visual Studio 2010 no problems.
  5. #5
    Please try the following:
    SIU.DirectMethods.LoadPageMenu(reqPage, idObj, {
        failure: function() {
            alert("failure");
        },
        success: function() {
            alert("success");
        }
    });
    and
    <ext:Store runat="server">
        <Proxy>
            <ext:PageProxy>
                <Listeners>
                    <Exception Handler="alert('Exception');" />
                </Listeners>
            </ext:PageProxy>
        </Proxy>
        <Listeners>
            <Exception Handler="alert('Exception');" />
        </Listeners>
    </ext:Store>
    Does it catch the error?
  6. #6
    Hi

    It doesn't throw error. Only the SIU.DirectMethods.LoadPageMenu success message.

    I removed the grdDataStore (with grdDataStore_ReadData DirectEvent) and the LoadPageMenu DirectMethod. I changed the code for load the pnlContent (in the Container page) as follows:

            var jsLoadPageMenu = function (reqPage, idObj) {
    
                var strLink;
                var objContainer = <%=pnlContent.ClientID%>;
                
                switch (reqPage)
                {
                    case 'User':
                        strLink = '/Pages/Users/Search.aspx';
                        break;
                    case "UserEdit":
                        if ((idObj == null) || (idObj == ""))
                            strLink = "/Pages/Users/AddEdit.aspx";
                        else
                            strLink = "/Pages/Users/AddEdit.aspx?EditId=" + idObj;
                        break;
                    case "Company":
                        strLink = "/Pages/Companies/Search.aspx";
                        break;
                    case "CompanyEdit":
                        if ((idObj == null) || (idObj == ""))
                            strLink = "/Pages/Companies/AddEdit.aspx";
                        else
                            strLink = "/Pages/Companies/AddEdit.aspx?EditId=" + idObj;
                        break;
                    case "Location":
                        strLink = "/Pages/Locations/Search.aspx";
                        break;
                    case "LocationEdit":
                        if ((idObj == null) || (idObj == ""))
                            strLink = "/Pages/Locations/AddEdit.aspx";
                        else
                            strLink = "/Pages/Locations/AddEdit.aspx?EditId=" + idObj;
                        break;
                    case "LocationObject":
                        strLink = "/Pages/Locations/LocationObjects.aspx?EditId=" + idObj;
                        break;
                    case "Object":
                        strLink = "/Pages/Objects/Search.aspx";
                        break;
                    case "ObjectEdit":
                        if ((idObj == null) || (idObj == ""))
                            strLink = "/Pages/Objects/AddEdit.aspx";
                        else
                            strLink = "/Pages/Objects/AddEdit.aspx?EditId=" + idObj;
                        break;
                    case "HistoricalData":
                        strLink = "/Pages/Objects/HistoricalData.aspx?EditId=" + idObj;
                        break;
                }
    
                objContainer.getLoader().load(
                    {
                        url: strLink,
                        loadMask: {
                            showMask: true
                        }
                    }
                );
            };
    And the problem continues.
  7. #7
    Quote Originally Posted by Kricher View Post
    It doesn't throw error. Only the SIU.DirectMethods.LoadPageMenu success message.
    So, a success handler is executed for a failure request? I don't know how it can be.

    As for the pnlContent's Loader, I don't see an Exception listener for that.

    And the problem continues.
    Just to clarify. Currently, we are trying to catch that error and just handle it in a proper way. We don't know why the redirection happens. Have you investigated that?
    http://stackoverflow.com/questions/8...eing-restarted
  8. #8
    Quote Originally Posted by Daniil View Post
    So, a success handler is executed for a failure request? I don't know how it can be.
    When I said only the SIU.DirectMethods.LoadPageMenu success message, I said that the message in the success handler is showed

    SIU.DirectMethods.LoadPageMenu(reqPage, idObj, {
        failure: function() {
            alert("failure");
        },
        success: function() {
            // This message
            alert("success");
        }
    });
    I mean, I don't receive error.

    Quote Originally Posted by Daniil View Post
    Just to clarify. Currently, we are trying to catch that error and just handle it in a proper way. We don't know why the redirection happens.
    Yes, I know. Just I wanted to show that the problem appears with the Ext Net's request, both page or data loading in the pnlContent. Looks like the server doesn't control properly the Ajax's requests and it redirects to Login page.

    Quote Originally Posted by Daniil View Post
    I'm going to add this because the IIS isn't mine. It is in a 3rd party hosting.


    Additionally, I conducted another test: I changed the authentication mode (forms to none) and I can navigate without this problem.

Similar Threads

  1. How can I Load aspx Page in Panel?
    By archana in forum 1.x Help
    Replies: 2
    Last Post: Dec 16, 2011, 4:29 AM
  2. how to load data to grid panel in page load
    By andylaiyongsing in forum 1.x Help
    Replies: 1
    Last Post: Apr 16, 2010, 10:27 AM
  3. Replies: 3
    Last Post: Feb 03, 2010, 10:11 AM
  4. [CLOSED] How to load a page from a Panel?
    By flormariafr in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Feb 01, 2010, 7:14 PM
  5. Load a page to a panel not working...
    By fabiomarcos in forum 1.x Help
    Replies: 2
    Last Post: Jan 23, 2009, 3:50 PM

Tags for this Thread

Posting Permissions