I don't know how many novice programmers there are here but I have a pretty tough question. I've been trying to figure it out for a while now. I'm looping through ever member I have and for each member I am looping through all 5 of their events. In addition as I'm looping I am reading their "EventClosed" node in each xml file. If the string returns "closed" it should change the xml transform source. But for some reason it isn't reading the node. I'm thinking maybe because I call close on the first loop and the name is never changed so it stays closed but idk... Any ideas?
Code:
public void ListUsers(MembershipUserCollection users)
{
foreach (MembershipUser u in users)
{
int i = 1;
while (i < 5)
{
try
{
Xml myLabel = new Xml();
string completePath = Server.MapPath("~/Promoters/NewEvent/" + u.UserName + "Event" + i + ".xml");
if (!System.IO.File.Exists(completePath))
{
break;
}
myLabel.TransformSource = "Promoters/NewEvent/XSLTFile1.xslt";
System.Xml.XmlTextReader xReader = new System.Xml.XmlTextReader(completePath);
while (xReader.Read())
{
while (xReader.ReadToFollowing("EventClosed"))
{
string content = xReader.ReadElementContentAsString();
if (content == "closed")
{
myLabel.TransformSource = "Promoters/NewEvent/XSLTFile3.xslt";
}
}
}
xReader.Close();
myLabel.DocumentSource = completePath;
myLabel.ID = "xml" + i.ToString();
PlaceHolder1.Controls.Add(myLabel);
}
catch
{
}
i++;
}
}
}
>> 72 Hour Special <<