working with Microsoft Visual studio 2005, in C# and making a website.
my problem is simple, but for the life of me I cannot solve it. apparently I miss the brain connection for this specific problem because regardless of the multiple tutorials and howtos out there, I cannot seem to do it.
Okay, I need to display the contents of an XML file.
The xml file itself is made dynamically, but that shouldn't matter. the file is made, and the code I've written should read the xml file.
Label7.Text += "test: getting in the try function </br>";
XmlDataSource1.DataFile = Server.MapPath("userInfo.xml");
XmlDataSource1.DataBind();
DataList1.DataSourceID = "XmlDataSource1";
DataList1.DataBind();
this is the code that I believe should do the trick. I've tried litterally tens of other ways but none of them seem to work. this also doesn't work, but the reason I believe this might work is because if I in the aspx page manually set the datalist's datasource as XmlDataSource 1, and then when configuring the datasource, I can choose userInfo.xml, and voila, it shows a very small, very illogical part of the xml file. this of course is a succes, but I need to do it with c#.
I've tried repeaters, datagrids, textboxes, and nothing worked. I deleted the XmlDatasource, and just gave the xml file to the datalist, and it didn't work, I've made a testpage with just one function, to show the bloody xml file... and it didn't work... I asked my teacher, but she's slow, and I desperatly need to know how (getting all emotional now - really, I'm on the verge of crying. something so awfully simple and whatever I do, it doesn't work. aargh)