If your form1.html can be a form1.ascx user control, it should be easy. You
could dynamically load the usercontrol in your page.
dim form as Control = Page.LoadControl("form1.ascx")
Then use the control's FindControl method to find your controls
dim usernameTextBox as TextBox = ctype(form.FindControl(XMLs field name),
textbox)
if not usernameTextBox is nothing then
usernameTextBox.Text = XMLs value
end if
You'll probably need to support more than just textboxes, but that can also
easily be done by adding that to your xml file and looping through
everything:
for each node as XmlNode in XmlDocument.SelectSingleNode(XPATH)
dim c as Control = form.FindControl(node.attributes("name").value)
switch case node.attributes("type").value
case "textbox"
ctype(c, textbox).Text = node.attributes("value").value
case "dropdownlist"
ctype(c, DropDownList).selectedIndex
=node.attributes("value").value
end switch
next
Anyways, that's without an editor so it won't work as-is, but will hopefully
give you an idea.
Karl
"Jim Adams" <ji*******@hotmail.com> wrote in message
news:49**************************@posting.google.c om...
My ASP.Net (VB.Net) app needs to display a filled in form to a web
user from the following:
a) read a form files dynamically from disk (e.g. form1.html)
b) read its corresponding XML file (e.g. form1.xml - basically field
value pairs)
The form data should be merged back into the HTML form so that when
displayed to the user, it looks exactly like it did the moment before
they clicked the form's Submit button.
Any ideas on an approach would be great appreciated.
Thanks,
Jim