Hi i have an array that contains values, but the array does not have a definition Length property, I does have a definitions for: label,slice
My goal is to iterate thru the loop for response.write some xml, like so:
So how does one create a loop to handle this, my attempt did not work, it was something like this:
for (int i = 1; i <= listpc.Label.Length; i++)
{
for (int i = 1; i <= listpc.Slice.Length; i++)
{
Response.Write("xml");
}
}
My goal is to iterate thru the loop for response.write some xml, like so:
Code:
Response.Write("<Risk><Lables>");
Response.Write("<Risks name='"+ccp[0].Label+"' change='"+ccp[0].Slice+"'></Risks>");
Response.Write("</Lables>");
Response.Write("<Lables>");
Response.Write("<Risks name='"+ccp[1].Label+"' change='"+ccp[1].Slice+"'></Risks>");
Response.Write("</Lables>");
Response.Write("<Lables>");
Response.Write("<Risks name='"+ccp[2].Label+"' change='"+ccp[2].Slice+"'></Risks>");
Response.Write("</Lables>");
Response.Write("</Risk>");
So how does one create a loop to handle this, my attempt did not work, it was something like this:
for (int i = 1; i <= listpc.Label.Length; i++)
{
for (int i = 1; i <= listpc.Slice.Length; i++)
{
Response.Write("xml");
}
}