Creating a Web Form from an XML Description of It
i am assigned to web part of some project.My duty is to create web form from xml. These xml comes from window part and tells which controls are include in my web form and their properties.My xml Format is like below.
<Object type="System.Windows.Forms.Form">
<Property name="Name">Form1</Property>
<Property name="Text">Option</Property>
<Object type="System.Windows.Forms.RadioButton">
<Property name="Name">RadioButton1</Property>
<Property name="Size">86, 24</Property>
<Property name="Text">RadioButton1</Property>
<Property name="Location">175, 126</Property>
</Object>
<Object type="System.Windows.Forms.CheckBox">
<Property name="Name">CheckBox1</Property>
<Property name="Size">84, 24</Property>
<Property name="Text">Accept</Property>
<Property name="Location">84, 126</Property>
</Object>
<Object type="System.Windows.Forms.TextBox">
<Property name="Name">TextBox1</Property>
<Property name="Size">177, 20</Property> 1
<Property name="Text">Singapore</Property>
<Property name="Location">84, 88</Property>
</Object>
<Object type="System.Windows.Forms.Label">
<Property name="Name">Label1</Property>
<Property name="Size">100, 23</Property>
<Property name="Text">Name</Property>
<Property name="Location">7, 53</Property>
</Object>
<DataSet1>
<Table1>
<TableName>TableOne</TableName>
<ItemName>item001</ItemName>
<Qty>100</Qty>
<Price>1000</Price>
</Table1>
<Table2>
<TableName>TableTwo</TableName>
<ItemName>item002</ItemName>
<Qty>200</Qty>
<Price>2000</Price>
</Table2>
</DataSet1>
</Object>
what is the best way to solve my problem开发者_如何学运维? i found some people used XmlSerialization, so, can i use this way or is there any other way?
- I hope you don't expect to be adding Windows Forms controls onto your web form.
- This doesn't make much sense. You will not only need to create a web form - you also need to be able to create code to handle events from the controls on the form. I don't see anything in your XML that describes that.
精彩评论