会话在Firfox和Chrome中迷路了

会话在Firfox和Chrome中迷路了

本文介绍了会话在Firfox和Chrome中迷路了的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我为会话分配了一个值,而会话值仅保留在Ie中,而不保留在Firefox或chrome中,为什么会发生这种情况?

我将在此事件中为会话分配值,并在像这样的按钮事件中使用会话值

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

protected void flUpload1_FileReceived(object sender, FileReceivedEventArgs e)
   {
       try
       {

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

       }
   }


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"] = "";
        }
    }

推荐答案


这篇关于会话在Firfox和Chrome中迷路了的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-03 03:57