MVC2 C # TextAreaFor contains ','

I am using MVC2 C #.

I have the following problem: if! ModelState.IsValid, I send the user back to an invalid form, where my text fields contain "," or duplicate everything that is in the text field.

<%=Html.TextAreaFor(x => x.Address, new { cols = 42, rows = 4 })%> <%=Html.HiddenFor(x => x.Address)%> 

I pass this information between forms, so I also have a value as hidden at the bottom of the form, I don’t know another way to transfer this information between forms (I have only 8 forms that use 1 ViewModel).

I know that hidden causes a problem, but does not know how to fix it.

Thank you in advance for your help.

Clare

+4
source share
1 answer

I duplicated the values ​​by specifying hidden fields on my aspx page. After deletion, the text fields no longer contain "," when the page was refreshed.

+5
source

Source: https://habr.com/ru/post/1335968/


All Articles