Hi everybody, please help...
So heres the scenario, I have populated a Generic List with strings from an SQL Select Command.
Then using Javascript, i want to retrieve certain elements from the Generic List variable. In server side, you can access the List in a syntax like this:
stringvariable = mylist.Item(5) 5 is the element number
In Javascript, you can access variables (not list types or array types) in something like this
var jvar = <%= aspvar %> where aspvar is an asp .net variable
I have tried retrieving an element from an asp .net in some code like this:
var jvar = <%= mylist.Item(5) %>
this works just fine. But of course, i want to be able to control which element i want to retrieve. I dont want to retrieve the 6th element all the time . The problem with the code above is that it doesnt recognize Javascript variables inside the <% %> tags. So if there could be ways to put in Javascript variables inside the <% %> tags then I could now control it perfectly.
So heres the scenario, I have populated a Generic List with strings from an SQL Select Command.
Then using Javascript, i want to retrieve certain elements from the Generic List variable. In server side, you can access the List in a syntax like this:
stringvariable = mylist.Item(5) 5 is the element number
In Javascript, you can access variables (not list types or array types) in something like this
var jvar = <%= aspvar %> where aspvar is an asp .net variable
I have tried retrieving an element from an asp .net in some code like this:
var jvar = <%= mylist.Item(5) %>
this works just fine. But of course, i want to be able to control which element i want to retrieve. I dont want to retrieve the 6th element all the time . The problem with the code above is that it doesnt recognize Javascript variables inside the <% %> tags. So if there could be ways to put in Javascript variables inside the <% %> tags then I could now control it perfectly.