jokismoki Posted May 11, 2015 Share Posted May 11, 2015 how to read xml nodes with same name in c#? I have XML file with a users, and their personal informations(name, surname, age, photos...). I'm displaying this infos in gridview, and everything is ok. Just cannot select one photo to display in the gridview, one photo for every user, like profile photo. I cannot do this cause there is not a tag . There are more tags with same name like in example below. So i'm trying to select all infos, put in datatable, and display in gridview control with Eval("Foto") functioon. But photos cannot be displayd because in evel function cannot be inserted more photos in same time. This is the structure of the photos in the XML document: <User><Name>User name</Name><Surname>User surname</Surname><Foto>http://website.com/images/image1.jpg</Foto><Foto>http://website.com/images/image2.jpg</Foto><Foto>http://website.com/images/image3.jpg</Foto><Foto>http://website.com/images/image4.jpg</Foto></User> This is the gridview control which i use <asp:GridView ID="GridView1" ShowFooter="false" ShowHeader="false" CssClass="tablepress-id-N" runat="server" AutoGenerateColumns="false" AllowPaging="true" OnPageIndexChanging="OnPageIndexChanging" onrowdatabound="GridView1_RowDataBound"><Columns><asp:TemplateField><ItemTemplate><li class="objectListItem"><div style="float:left;width:12%;margin-right:5%;"><asp:Image ID="Image1" runat="server" ImageUrl='<%# Eval("Foto")%>'></asp:Image></div></ItemTemplate></asp:TemplateField></Columns><pagerstyle cssclass="gridviewPager"></pagerstyle></asp:GridView> Where i make a mistake? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now