Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post May 05, 2012 07:46 PM by francesco abbruzzese
Member
589 Points
463 Posts
May 05, 2012 07:29 PM|LINK
http post request from ajax call sends data like:
-----------------------------7dc37d1370812 Content-Disposition: form-data; name="Kmkonto" 21510 -----------------------------7dc37d1370812 Content-Disposition: form-data; name="Kmprotsent" 20,00 ...
(This format is required to return image data also together with other data).
MVC2 controller is defined as
public ActionResult Edit(FormCollection form)
Trying to get form elements returns duplicate values:
form["Kmkonto"] returns 21510,21510
form["Kmprotsent"] returns 20,00,20,00
How to get correct values:
form["Kmkonto"] should return 21510
form["Kmprotsent"] returns 20,00
Using MVC2 and ASP .NET 3.5
All-Star
20912 Points
3279 Posts
May 05, 2012 07:46 PM|LINK
if you get duplicate data is because there are TWO input fields with the same name and content.
kobruleht
Member
589 Points
463 Posts
How to get correct values from posted form-data
May 05, 2012 07:29 PM|LINK
http post request from ajax call sends data like:
(This format is required to return image data also together with other data).
MVC2 controller is defined as
public ActionResult Edit(FormCollection form)
Trying to get form elements returns duplicate values:
form["Kmkonto"] returns 21510,21510
form["Kmprotsent"] returns 20,00,20,00
How to get correct values:
form["Kmkonto"] should return 21510
form["Kmprotsent"] returns 20,00
Using MVC2 and ASP .NET 3.5
francesco ab...
All-Star
20912 Points
3279 Posts
Re: How to get correct values from posted form-data
May 05, 2012 07:46 PM|LINK
if you get duplicate data is because there are TWO input fields with the same name and content.
Mvc Controls Toolkit | Data Moving Plug-in Videos