473,499 Members | 1,955 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Merging HTML form with external data

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
Nov 18 '05 #1
3 1311
You already described an approach. If you can describe the business
requirements of your app, perhaps we can offer different approaches. Or,
perhaps I misunderstood you. What sort of ideas are you looking for?

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"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

Nov 18 '05 #2
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

Nov 18 '05 #3
Unfortunately, these will be HTML forms (not .Net) read from disk, so I
cannot take advantage of iterating through the ASPX controls in a page.

Also, reading the forms will be dynamic and there will be additonal
forms added to the system on-the-fly in the future.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2055
by: Dan Nash | last post by:
Hi guys I wonder if you could help. I'm trying to create a bespoke interface for mail merging from an Access database in Word. At the moment, I'm just trying it with CSV files, and it works....
5
3745
by: Donald Firesmith | last post by:
Are html tags allowed within meta tags? Specifically, if I have html tags within a <definition> tag within XML, can I use the definition as the content within the <meta content="description> tag? ...
2
1522
by: Klatuu | last post by:
Whew, I've struggled my way through figuring out how to use XML to transport data..now I can imagine what having a baby is like :) But, I'm stuck now. I generate the XML (single table, no...
2
3759
by: meburke | last post by:
I've written quite a bit of early php code, but nothing really web and database-specific (more like administrative and maintenance stuff for LINUX), but now I need to develop some serious web...
3
1864
by: Patrick | last post by:
I have got 2 XML documents, both of which conform to the same XSD Schema, which define possible optional elements. The 2 XML documents contain 2 disjoint set of XML elements. What is the best,...
0
1493
by: steve | last post by:
Hi there, I am trying to import data from 2 dbf files into excel using the 'get external data' option which launches ms query. Ultimately I am merging data with a right join statement. I can...
1
1284
by: Jim Adams | last post by:
My ASP.Net (VB.Net) app needs to display a filled in form to a web user from the following: a) read HTML form files (not ascx) dynamically from disk (e.g. form.html) b) read its corresponding...
9
2140
by: Phil_Harvey | last post by:
I am redoing my website and trying to get it to do something more exciting using Javascript. I did normal Java at university and code at work in VB.NET. I have got reasonably far into what I want...
0
2557
by: ErikaW | last post by:
Hi all, I've tried to google this but could not find a clear solution. I have a Web application developed in JDevloper using mostly html and Javascript. I have a pre-defined PDF form which I merge...
0
7131
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7007
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7174
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7220
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6894
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7388
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5470
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4600
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3091
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.