Hi,
I made a list of sessions in the cs code
List
if(k==0) { Response.Write("02.25" + sectionList[0]); Session["sectionList"] = sectionList; sessions.Add((Session["sectionList"] as String)+ ","); k = 7; } else { Response.Write("02.25"+ sectionList[0] + sectionList[1]); Session[String.Format("sectionList{0}", k)] = sectionList; //form the sectionListnumber for that matching iners in ff file sessions.Add((Session[String.Format("sectionList{0}", k)] as String)+ ","); } ... ... Session["sessions"] = sessions; if ((HttpContext.Current.Session["sessions"] as List) != null) { Response.Write(HttpContext.Current.Session["sessions"] as List ); }//here I see that it is not null
in aspx I have
var sessions='<%=Session["sessions"]%>'; //02.27 var sess=sessions.split(","); ... ... var lineStringi=[]; var spli=[]; var l=8; for (var r=0;r<kmax;r++) { lineStringi[l]= sess[r].ToArray() ; spli[l-6]=lineStringi[l].split(','); var spl+String.Format("{0}", l) = lineString8.split(',');--%> l++; alert("spli[l-6]"+spli[l-6]); }but I get that spli[l-6] Is undefined.
Can anybody help me please what I do wrong, how to pass and operate with the list of Sessions passed from the cs file?
Thanks
NelPosted Mar 1, 2015, 5:25 PM
I actually have Session["8"], Session["9"],....which hold lists of values But I don't know how many exactly I will have, the sessions depend on the number of files in folder They should be created dynamically I create them like
if(k==0)
{
Session["sectionList"] = sectionList;
sessions.Add((Session["sectionList"] as String)+ ",");
k = 7; }
else {
Session[String.Format("sectionList{0}", k)] = sectionList; //form the sectionListnumber for that matching iners in ff file
sessions.Add((Session[String.Format("sectionList{0}", k)] as String)+ ",");
}
So I create list of sessions as well, to keep the sessions created dynamically sessions is actually List
In the aspx code I have
var l=8;
{
for (var r=0;r
lineStringi[l]= sess[r].ToArray() ;
spli[l-6]=lineStringi[l].split(',');
l++;
alert("spli[l-6]"+spli[l-6]);
}
I hope I am clearer now Please tell me if you need some more info.Thanks in advance
Joginder BangerPosted Feb 28, 2015, 1:48 AM
share your data for better understanding.