Hello I am having trouble using an array of information. I am storing the following type data in a Sesion variable on page1.asp:
Session("GridFields"="A, B, C, D"
On page2.asp I need to extract these in a for-loop but the problem I have discovered is that they are not each within quotes.
As a test, this works on page2.asp (recreating the values):
Dim aFields
aFields = array("A", "B", "C", "D"
This DOES NOT work (grabbing the data from the session var:
Dim aFields
aFields = Split(Session("GridFields", ","
I tried various cocantenation methods but do not quite have it (bad idea maybe too). FYI here is where it blows up - each field must be in quotes to work:
<% for z = 0 to UBound(aFields) %>
<% sCurrFieldName = aFields(z) %>
<% sCurrFieldValue = oRS(sCurrFieldName) %>
<% if sCurrFieldValue = "" then %>
<td> </td>
<% else %>
<td><%=sCurrFieldValue%></td>
<% end if %>
<% next %>
Tough one (for me).
What can you recommend guys!
Michael
Session("GridFields"="A, B, C, D"
On page2.asp I need to extract these in a for-loop but the problem I have discovered is that they are not each within quotes.
As a test, this works on page2.asp (recreating the values):
Dim aFields
aFields = array("A", "B", "C", "D"
This DOES NOT work (grabbing the data from the session var:
Dim aFields
aFields = Split(Session("GridFields", ","
I tried various cocantenation methods but do not quite have it (bad idea maybe too). FYI here is where it blows up - each field must be in quotes to work:
<% for z = 0 to UBound(aFields) %>
<% sCurrFieldName = aFields(z) %>
<% sCurrFieldValue = oRS(sCurrFieldName) %>
<% if sCurrFieldValue = "" then %>
<td> </td>
<% else %>
<td><%=sCurrFieldValue%></td>
<% end if %>
<% next %>
Tough one (for me).
What can you recommend guys!
Michael