linq to xml. read. and assign to ViewData..noob

Posted by raklos on Stack Overflow See other posts from Stack Overflow or by raklos
Published on 2010-03-22T16:52:55Z Indexed on 2010/03/22 17:01 UTC
Read the original article Hit count: 364

Filed under:
|
|

I have some xml similar to this:

<?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>

using linq-xml how can i assign each resource here as a key value pair with the ViewData collection.

Thanks.

© Stack Overflow or respective owner

Related posts about c#

Related posts about LINQ