Databinding syntax with xmlnodelist

R

Roshawn Dawson

Hi,

I have the following line of code that continues to give me the "Object
not set to an instance of an object" error:

<%# CType(Container.DataItem,
System.Xml.XmlNode))("ElementName/ElementName").InnerText %>

Could someone tell me why this isn't working? It may help to tell you
that I'm binding a repeater control to an xmlnodelist (the xmlnodelist's
data comes from an xml file that has a root namespace).

Thanks in advance,
Roshawn
 
R

Roshawn Dawson

Never mind. I've figured it out:

<%# Ctype(Container.DataItem,
System.Xml.XmlNode))("ElementName").Item("ElementName").InnerText %>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top