Processing XML form input in ASP
- by Omar Kooheji
I'm maintaining a legacy application which consists of some ASP.Net pages with c# code behinds and some asp pages. I need to change the way the application accepts it's input from reading a set of parameters from some form fields to reading in one form field which contains contains some XML and parsing to get the parameters out.
I've written a C# class that takes an The NameValueCollection from the C# HttpRequest's Form Element.
Like so
NameValueCollection form = Request.Form;
Dictionary<string, string> fieldDictionary = RequestDataExtractor.BuildFieldDictionary(form);
The code in the class looks for a particular parameter and if it's there processes the XML and outputs a Dictionary, if its not there it just cycles through the Form parameters and puts them all into the dictionary (Allowing the old method to still work)
How would I do this in ASP? Can I use my same class, or a modified version of it? or do I have to write some new code to get this working?
If I have to write ASP code Whats the best way to process the XML in ASP?
Sorry if this seems like a stupid question but I know next to nothing about ASP and VB.