[Download Code] |. [Run Sample] One of the most frequent tasks that web developers receive is that of creating a form to collect user input One solution is to use an ASP.NET web page to create an XML file that will be used as the basis for a web form. The three part article, XML form Generator, will demonstrate how to easily create an XML form that will save user input as an XML file. By using the run sample link above you view all the source code and See an online demo.
First, WE Are Going to NEED A Web Page That Will Create An XML Files (XML Forms) in this format:
XML Version = "1.0" Standalone = "YES"?>
String data>
Fields>
.......
NewDataSet>
Here is the expedition of the fields:
Control - The type of ASP.NET web server control Data - The type of data that the form will take as input Required - Is the field required Order - The order that the fields will be displayed in the form Label - The field label that is Displayed On The Form ID - The ASP.NET Web Server Control ID TEXT - This Field is Use in Multiple Ways:
For TextBox, Multiline, Hidden, Password and Label controls this is the default value (Note: Multiline, Hidden, Password are all TextBox controls) For DropDownList, RadioButtonList and CheckBoxList and ListBox controls a comma separated list will be displayed as separate items For a Checkbox Control It The Text Displayed Next To IT
How To Run The Sample:
Download and extract the files to a virtual directory. Use your web browser to navigate to the XmlFormGen.aspx file in that virtual directory. To load the included test form type in Test.xml and click the Load Form button. To create a new form Type in the name of the form and add a .xml Extension. The Click on the new form button. You can no, delete, and add fields on you form.that's all there is to create a form. i know what you ' re thinking, all this does is create XML files. But, it actually creates a very specific kind of XML file that I an XML form calling am. The next part of this series will demonstrate how we can use these XML forms to capture user input And Save the results to Xml files.