26 February 2007
Solution: How to get the InnerText value of a node when using XmlDataSource
Lets say you have this xml:
<Blog>
<BlogPost Date="2/21/2006" Title="Blog Title">
Blog Content
</BlogPost>
</Blog>
And you are using an XmlDataSource to run it through a repeater.
You can easily get the attributes like so: <%#Eval("Date")%>
To get the innerText (the blog content) one option is to use the XPath operator like so: <%# XPath(".") %>
Comment Notification
If you would like to receive an email when updates are made to this post, please register here
Subscribe to this post's comments using
Comment Policy: No HTML allowed. URIs and line breaks are converted automatically. Your e–mail address will not show up on any public page.