문제

I create a RadRotator in run time and i bind on an xml file .


I don't know How to get the title from the rotator to set the text of my label .


lbl_date.Text = (lbl_date.NamingContainer as RadRotatorItem).DataItem 

My xml part :

<news pnumber="1" id="1"><event_id>578</event_id><event_type_id>1</event_type_id><language_id>2</language_id><title>meeting</title></news>
도움이 되었습니까?

해결책 2

Finally i get it :


lbl_date.Text = XPathBinder.Eval((((lbl_date.NamingContainer as RadRotatorItem)).DataItem), "./title", "");

다른 팁

Try using an XDocument to parse the XML:

var xdoc = XDocument.Parse(xml);

lbl_date.Text = xdoc.Root.Element("title").Value;

Note that the element name "title" used in the call .Element("title") is case sensitive.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top