Best approach to display xml file content in asp.net webpage

Jul 29 2016 3:02 AM

Hi Experts,

I would like to develop an UI in asp.net using C# for below kind of sample XML file.

I know we can go for XSLT transformations, after googling, in xslt we can mention plain HTML UI control. What I need to asp.net server controls and need to handle its events in code behind page.

I also know, in WPF after reading XML and prepare a xaml and give xaml to a render control, which will take care of displaying to UI

But I’m looking in asp.net webForm pages

Could anyone suggest best approach to follow with some samples?

 
Many Thanks,
 

Sample XML file

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<Root>

<Users>

<FirstName value=”TestFirst” />

<LastName value=”TestLast”/>

</Users>

<Machine>

<Name value="" host="" sycTime="1" maxCount="10" />

<url>http://255.255.255:8008</url>

</Machine>

<UISampleOne>

<Checkboxes value="true" />

<Columns>

<column columntext="FirstName" width="" datatype="string" isreadonly="true" />

<column columntext=" LastName " width="" datatype="date" isreadonly="false" />

<column columntext="Date" width="" datatype="date" isreadonly="false" />

</Columns >

<Filter>

<FilterType value="FirstName" label="string" />

<FilterType value="LastName" label="string" />

</Filter>

</UISampleOne>

<UISampleTwo>

<SectionOne>

<FName value=”SectionFName” />

<LName value=”SectionLName”/>

</SectionOne>

<SectionTwo>

<FName value=”SectionFName” />

<LName value=”SectionLName”/>

</SectionTwo>

</UISampleTwo>

<UISampleThree>

<ListsOne>

<list list_name="ListName1" list_path="/ABC/Xyz">

<item item_text="ItemText" item_name="ItemName1"/>

<item item_text="ItemText" item_name="ItemName1"/>

</list>

<list list_name="ListName2" list_path="/ABC2/Xyz2">

<item item_text="ItemText" item_name="ItemName1"/>

<item item_text="ItemText" item_name="ItemName1"/>

</list>

</ListsOne >

<ListsTwo>

<list list_name="ListName1" list_path="/ABC/Xyz">

<item item_text="ItemText" item_name="ItemName1"/>

<item item_text="ItemText" item_name="ItemName1"/>

</list>

<list list_name="ListName2" list_path="/ABC2/Xyz2">

<item item_text="ItemText" item_name="ItemName1"/>

<item item_text="ItemText" item_name="ItemName1"/>

</list>

</ListsTwo>

</UISampleThree>

</Root>

Brought to you by:

Answers (3)