Click here to Skip to main content
16,011,905 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi
I am assigning a value to session and the session value is getting retained only in Ie and not in Firefox or chrome why is that happening?

I am assigning the values to session in this event and using the session value in a button event like this
C#
protected void flUpload1_FileReceived(object sender, FileReceivedEventArgs e)
   {
       try
       {

           string sFileName = e.File.FileName;
           filecount = imageDetails.Count;
           Session["Filelist"] = sFileName + ",";
       }
       catch (Exception ex)
       {

       }
   }

C#
try
        {
            if (Session["Filelist"].ToString() != null && Session["Filelist"].ToString() != "")
            {
                string[] sFileArr = Session["Filelist"].ToString().Split(',');
                XmlDocument XDoc = new XmlDocument();
                XmlElement XElemRoot = XDoc.CreateElement("Cars");
                XDoc.AppendChild(XElemRoot);
                for (int i = 0; i < sFileArr.Length; i++)
                {
                    if (sFileArr[i] != null && sFileArr[i] != "")
                    {
                        XmlElement Xsource = XDoc.CreateElement("CarName");
                        XElemRoot.AppendChild(Xsource);
                        XmlElement XTemp = XDoc.CreateElement("CarimgLoaction");
                        XTemp.InnerText = "Images_new\\" + sFileArr[i].ToString();
                        Xsource.AppendChild(XTemp);
                    }
                }
                XDoc.Save(Server.MapPath("ConfigV2") + "\\test.xml");
                string sXmlFile = Server.MapPath("ConfigV2") + "\\test.xml";
                string sXsltFile = Server.MapPath("ConfigV2/xslt") + "\\cars.xslt";
                this.imgcontainer.InnerHtml = Render.RenderXmlFile(sXmlFile, sXsltFile);
            }
        }
        catch (Exception ex)
        {
        }
        finally
        {
            Session["Filelist"] = "";
        }
    }
Posted
Updated 4-Sep-12 1:55am
v4
Comments
sjelen 4-Sep-12 7:44am    
Your question does not provide enough info, improve question with more details and a code snippet.

1 solution

 
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