dcsimg
www.webdeveloper.com
Results 1 to 3 of 3

Thread: how to read xml nodes with same name in c#?

  1. #1
    Join Date
    Apr 2015
    Posts
    3

    how to read xml nodes with same name in c#?

    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:

    Code:
    <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>

    Does anybody have this problem before and how to solve it? Pls for help

  2. #2
    Join Date
    Apr 2015
    Posts
    32
    Does this work?

    /User/Foto[0]

  3. #3
    Join Date
    Apr 2015
    Posts
    3
    No cause i cannot put in gridvire this Eval("/User/Foto[0]")

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles