Reputation: 14266
We are creating a ASP.NET MVC 4 application for a client where we need to create a xml from the HTML form in view and store it in the database.
So I want to know best approach for doing this? Does any one have an idea.
I want some thing like this.
Suppose A form has firstname and lastname textbox then when I save that form it will create a xml based on the form with firstname and lastname value.
Any help would be appreciated.
Upvotes: 0
Views: 671
Reputation: 11995
You have to do this in javascript. Things are much easier if you use libraries like jquery.
Handle the the form submit event. In it you basically have to seralize the http form. The following post will give you an idea: https://stackoverflow.com/a/2088897/145682
The link talks about using a particular plugin called json2xml
But what do you do for file uploads?!
Well there are workarounds for that:
Upvotes: 1