2
我有类似这样的一些XML:linq to xml。读。并分配给ViewData..noob
<?xml version="1.0" encoding="utf-8" ?>
<data>
<resources>
<resource key="Title">Alpha</resource>
<resource key="ImageName">Small.png</resource>
<resource key="Desc">blah</resource>
</resources>
</data>
使用LINQ的XML我怎么可以在这里分配给每个资源的键值对与ViewData的集合。
谢谢。
谢谢,你的答案有帮助。尽管我使用了doc.Descendants,而不是doc.Root.Descendants – raklos 2010-03-22 17:27:22