• 1.5k
  • 716
  • 1m

Dynamically naming the Session in aspx file

Feb 25 2015 2:55 PM


I want to dynamically give the names of the Sesions in the aspx file, depending on the current number of files in certain folder

Here is my try

 var kmax='<%= Session["kmax"] %>';

                var l=2;
                for (var t=8;t<kmax+8;t++)
                    var lineString+String.Format("{0}", t) = '<%= String.Join(",",(Session[String.Format("{0}",t)] as List<String>).ToArray()) %>';
                    var spl+String.Format("{0}", l) = lineString8.split(',');

but on the bold t in this code I get a message that it is not recognized in the current context and it is underlined with red color

Can anybody help me how to do this?
Thank you

Answers (3)