Create dynamic control C# ASP.NET

  • Thread starter Thread starter mpriem
  • Start date Start date
M

mpriem

Hi,

I am trying to create a webapplication which reads a Xml Document and
dynamically creates tables containing the values. The Xml Document is
created by a windows service I programmed. So if I need to change the
content, I can.

The format for the Xml document is as followed

<ROOT>
<SERVER Name = servername>
<STORAGEGROUP Name = SGname>
<STORE Name = Storename>
<USERS Count = intcount>
</USERS>
</STORE>
</STORAGEGROUP>
</SERVER>
<SERVER Name = severname>
......
........
.....
etc
</ROOT>


I want to create a table for Every Servernode and add
Storagegroup,Store,Users attributes.
Which control do I use and can someone provide some logic which can get
me started?
Thanks in advance!

Regards,

Mark
 
You have two options as I see it ( maybe there are more )

1.) Manually Construct the table using the classes in the XML namespace and
build the HTML by opening the XML file and looping through the elements and
attributes and creating the HTML strings as you go.

Or. . .

2.) Use XMLT ( Transforms ) to transform the XML data into an HTML output.

I would recommend 2.) although both methods will really need you to do some
reading up, suggest you use the Help and Google to do some background
reading. Again there are classes in the system.Xml.Xsl namespace for this as
well.

Both approaches can be a little tricky, so experiment first with some very
simple XML files and then go from there.
 
2.) Use XMLT ( Transforms ) to transform the XML data into an HTML output.

Should have read

2.) Use *XSLT* ( Transforms ) to transform the XML data into an HTML output.
 
Back
Top