开发者

MVC2 C# TextAreaFor contains ', ,'

开发者 https://www.devze.com 2023-02-05 10:37 出处:网络
I am using MVC2 C#. I have the fol开发者_如何学运维lowing issue: if the !ModelState.IsValid, I send the user back to the invalid form where my textareas contain \',\' or duplicates whatever is in the

I am using MVC2 C#.

I have the fol开发者_如何学运维lowing issue: if the !ModelState.IsValid, I send the user back to the invalid form where my textareas contain ',' or duplicates whatever is in the textarea.

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

I pass this information inbetween forms, so I also have the value as a hidden at the bottom of the form, don't know another way of passing this information between forms (I have 8 forms in total which use 1 ViewModel).

I know the hidden is causing the issue but don't know how to fix it.

Thanks in advance for any help

Clare


I had duplicated the values by having hidden fields on my aspx page. Once removed the textareas no longer contained ', ,' when the page was refreshed.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号