Hi,
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"] %>';
if(kmax>1)
{
var l=2;
for (var t=8;t
var lineString+String.Format("{0}", t) = '<%= String.Join(",",(Session[String.Format("{0}",t)] as List
var spl+String.Format("{0}", l) = lineString8.split(',');
l++;
}
}
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

Jignesh TrivediRank #16 · 50.3K reputationPosted Feb 25, 2015, 6:28 PM EST
Here I thing problem due to server side code and client side code are mixed.
also there is an problem in following line
var lineString+String.Format("{0}", t) = '<%= String.Join(",",(Session[String.Format("{0}",t)] as List).ToArray()) %>';
here declaration of variable is wrong. it may be...
var lineString = '<%= String.Join(",",(Session[String.Format("{0}",t)] as List).ToArray()) %>';
not sure it help you.
NelRank #2,060 · 702 reputationPosted Feb 26, 2015, 3:02 AM EST
for(var t;t
var lineString = '<%= String.Join(",",(Session[String.Format("{0}",t)] as List
.
.
Jignesh TrivediRank #16 · 50.3K reputationPosted Feb 26, 2015, 6:17 PM EST
hi,
True
but here t is define in java script and try to use it at server side
I think this is problem...
hope this will help you.