Form Collection in MVC returns concatenated old value with new value
I have a table set up in my view which contains text boxes 开发者_运维技巧that are editable. I have 2 on the UI and receive no problems before with the post back only sending back the new value. Now I have added a third text box to this list, and when the form come back, it always contains the new value with the old value.
For example I have a percentage in one of the text boxes. Before if i change the percentage from 100 to 50 in my controller I would have a value of 50 ... now the controller for that form key gets back 50,100.
Can anyone please shed some light on this issue? It was working perfectly well until I added this third text box. Each text box has a unique name that is comprised of unique keys in the table. (ie gname,dname,url could be a key and dname,gname,url is another key for a different textbox).
Usaully if elements have the same name they will be returned with multiple values. I would double check the names and ids on the elements.
Please check that the control which is showing double value ,have written only once in the from or HTML page. Because, it solved my issue.
精彩评论