Problem with Session in IE, but not in Firefox and Chrome

  1. #1

    Problem with Session in IE, but not in Firefox and Chrome

    Friends,
    I have a little big problem is that I'm creating a session variable at the time that the user is identified, this works fine.
    When I create a new user (I use a windows component with a user control), I do it without problem and recharges my GridPanel. When
    I edit a user's information, is published without problem, but my
    GridPanel not recharge, said that the session variable is null. But
    this only happens with Internet Explorer, I tried the same thing in
    Firefox and Chrome and my GridPanel recharges without any problem.

    You could help me, thanks.
  2. #2

    RE: Problem with Session in IE, but not in Firefox and Chrome

    Please post some code with demonstrates how to reproduce this issue.

    Geoffrey McGill
    Founder
  3. #3

    RE: Problem with Session in IE, but not in Firefox and Chrome

    EmployeeList.aspx
    -----GRID PANEL
          <Buttons>
          <ext:Button ID="bNewEmployee" runat="server" Text="Agregar" Icon="Add">
              <AjaxEvents>
              <Click OnEvent="NewEmployee" />
              </AjaxEvents>
          </ext:Button>
          <ext:Button ID="bEditEmployee" runat="server" Text="Editar" Icon="NoteEdit">
              <AjaxEvents>
              <Click OnEvent="EditEmployee" >
              <ExtraParams>
                    <ext:Parameter Name="Values" Value="Ext.encode(#{GridEmployee}.getRowsValues())" Mode="Raw" />
                </ExtraParams>
              </Click>
              </AjaxEvents>
          </ext:Button>
        </Buttons>
    EmployeeList.aspx.cs
    using System;
    ...
    public partial class EmployeeList : System.Web.UI.Page
    {
        GCThunder.Library.Platform.Web.SessionInfo si = null;
         protected void Page_Load(object sender, EventArgs e)
        {
            
              if(!Ext.IsAjaxRequest)
                  wucUserWindow1.Hide();
            si = (GCThunder.Library.Platform.Web.SessionInfo)this.Session["sInfo"];
            ...
            LoadEmployeeGrid();
        }
        private void SetGridColumns(GridPanel gridpanel)
        {
            ....
        }
       
        [AjaxMethod]
        public void ReloadData()
        {
            GridEmployee.Reconfigure();
            LoadEmployeeGrid();
            GridEmployee.Reload();
        }
    
        [AjaxMethod]
        public void LoadEmployeeGrid()
        {
            StoreEmployee.DataSource = DataEmployee();
            StoreEmployee.DataBind();
    
        }
        [AjaxMethod]
        protected void StoreEmployee_RefreshData(object sender, StoreRefreshDataEventArgs e)
        {
            LoadEmployeeGrid();
        }
    
    
        public void EditEmployee(object sender, AjaxEventArgs e)
        {
            int fieldId = 0;
            string jsonValues = e.ExtraParams["Values"];
            if (jsonValues != null)
            {
                
                Dictionary<string, string>[] parameters = JSON.Deserialize<Dictionary<string, string>[]>(jsonValues);
                foreach (Dictionary<string, string> kvp in parameters)
                {
                    fieldId = Convert.ToInt32(kvp["emp_id"]);
                }
            }
    
            wucUserWindow1.Show(si.CompanyId, fieldId,ActionType.UPDATE);
    
        }
    
        public void NewEmployee(object sender, EventArgs e)
        {
            wucUserWindow1.Show(si.CompanyId,0,ActionType.INSERT);
        }
    
        private List<object> DataEmployee()
        {
            EmployeeADO objectADO = new EmployeeADO();
            ArrayList alList = objectADO.GetEmployeeList(si.CompanyId);
             List<object> data = new List<object>(alList.Count);
            for (int i = 0; i < alList.Count; i++)
            {
                Employee objectData = (Employee)alList[i];
                data.Add(new object[]
                {
                    objectData.EmployeeId,
                    objectData.CompanyId,
                    objectData.DepartamentId...
                });
            }
            return data;
        }
    }
    wucUserwindow.ascx
           <Buttons>
            <ext:Button ID="bSaveEmployee" runat="server" Icon="Disk" Text="Grabar">
             <AjaxEvents>
                  <Click OnEvent="SaveEmployee" Success="Coolite.AjaxMethods.ReloadData();"></Click>
            </AjaxEvents>
            </ext:Button>
             <ext:Button ID="bUserCancel" runat="server" Icon="Delete" Text="Cerrar">
            <Listeners>
                  <Click Handler="#{winUser}.hide();Coolite.AjaxMethods.ReloadData();" />
             </Listeners>
            </ext:Button>
        </Buttons>
    wucUserwindow.ascx.cs
    using System;
    .....
    public partial class wucUserWindow : System.Web.UI.UserControl
    {
        SessionInfo si = null;
        public void Show(int companyId, int fieldId,aActionType actionType)
        {
            this.winUser.Show();
            this.hdnParamId.Text = string.Format("{0};{1};{2}", companyId, fieldId, Convert.ToInt32(actionType));
            if(actionType==ActionType.UPDATE)
                 LoadEmployeeData(companyId, fieldId);
                LoadCountries();
        }
        public void Hide()
        {
            winUser.Hide();
        }
    
        private void LoadEmployeeData(int companyId, int employeeId)
        {
            EmployeeADO objectADO = new EmployeeADO();
            Employee objectData = objectADO.GetEmployee(companyId, employeeId);
            txtLegalId.Text = objectData.EmployeeLegalId;
            txtName.Text = objectData.EmployeeFullName;
            txtLastName.Text = objectData.EmployeeLastName;
            ...
        }
    
    
        protected void SaveEmployee(object sender, EventArgs e)
        {
            string[] arrData = this.hdnParamId.Text.Split(';');
            if (arrData.Length < 3)
                return;
            int companyId = Convert.ToInt32(arrData[0]);
            int employeeId = Convert.ToInt32(arrData[1]);
            ActionType actionType = (ActionType)Convert.ToInt32(arrData[2]);
    
            EmployeeADO objectADO = new EmployeeADO();
            Employee objectData = new Employee();
            objectData.EmployeeLegalId = txtLegalId.Text;
            objectData.EmployeeFullName = txtName.Text;
            objectData.EmployeeLastName = txtLastName.Text;
            ...
            int i = objectADO.SaveEmployee(objectData, actionType);
            this.hdnParamId.Text = string.Format("{0};{1};{2}", companyId, employeeId, Convert.ToInt32(ActionType.UPDATE));
    
        }
    }

    if I create a new employee and update an existing employee, the information is stored correctly. But
    when employee information was updated saying that my session variable
    is null (ArrayList alList = objectADO.GetEmployeeList (si.CompanyId);)
    [NullReferenceException: Object reference not set to an instance of an object.]
    EmployeeList.DataEmployee () in C: \ Projects \ NET \ Web \ eBussines \ EmployeeList.aspx.cs: 234
    EmployeeList.LoadEmployeeGrid () in C: \ Projects \ NET \ Web \ eBussines \ EmployeeList.aspx.cs: 145
    EmployeeList.Page_Load (Object sender, EventArgs e) in c: \ Projects \ NET \ Web \ eBussines \ EmployeeList.aspx.cs: 39


    But when the employee was created, the session variable is not null and load the list of employees in the GridPanel

Similar Threads

  1. [CLOSED] Problem with Firefox and Chrome
    By Stefanaccio in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: Dec 07, 2011, 12:43 PM
  2. Problem with a example in Chrome and Firefox...
    By Tanielian in forum 1.x Help
    Replies: 2
    Last Post: Apr 07, 2011, 6:14 PM
  3. Replies: 4
    Last Post: Nov 22, 2010, 10:25 AM
  4. [CLOSED] Problem with gridpanel column resizing in firefox and chrome
    By Pablo_Azevedo in forum 1.x Legacy Premium Help
    Replies: 25
    Last Post: Sep 14, 2010, 2:10 PM
  5. Replies: 0
    Last Post: Jun 03, 2009, 3:14 PM

Posting Permissions