Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Field arrangement in the xml file as displayed in the asp page?

Status
Not open for further replies.

sbind77

Programmer
Oct 2, 2001
29
0
0
US
Hello everybody..
Am a beginner in .net.I have an issue to be resolved.I have an asp page that lists out some 'n' number of fields like SPID,BASIC TITLE,BASIC FIRST NAME,HOME PHONE NUMBER etc.After entering the values for these fields in a textbox and once when i click SUBMIT button i need the fields listed in that asp page in a text file but in an xml format.so when i open the final text file i must get something like this:
<BATCH NAME="134323NXDM2323432"><DOCUMENT><PAGE DOC_ID="NX23232", SPID="asd",BASIC TITLE="sadf",BASIC FIRST NAME="sadf",HOME PHONE NUMBER="23423432"...></PAGE></DOCUMENT></BATCH>

Now the issue i face is the field order in the text file is not the same as listed in the asp page .So if i have spid,basic title,gna logo in the asp page, i get gna logo,spid,gna pct something like that.The code that ive used to get all the field names in the text file is
for each field_name in request.form
xmlNode.setAttribute field_name, request.form(field_name)


So i get all the fields in an xml format in the text file but t field order differs.So plz suggest me any solution.

Thank You
sbind77
 
If they're not in any particular order then I would do either...

A) Add them manually in the order that you want
B) Give each textbox a sequence number (like Textbox1, Textbox2, etc) then loop through in sequence
 
Well thanks for ur suggestion.But as u said i get some 70 text files generated .So its not really possible for me to do the field arrangement manually.. The no. of fields again vary for each form as the fields tat i keep mentioning are the fields of a form.So they vary from one form to another.Any other suggestion??

Thank You
sbind77
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top