Click here to Skip to main content
15,884,766 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using textarea for allowing user to fill in some information.

User can enter many line in that and he presses enter between two paragraphs.

While submitting form i am saving textarea text in database which comes like
"test\r\n regards \r\n yours".

and while fetching that data from data it shows in same manner in textarea user has entered but not showing proper in span or div tag.

How can i do that .... please guide me
Posted
Updated 19-Feb-14 0:52am
v3

1 solution

I am using text area in ASP.NET MVC together with EF and everything is working fine. The generated HTML code is the next one:
XML
<textarea name="Comments" class="valid" id="Comments" style="width: 100%;" rows="5" cols="20">Raul's Test User
aaa
bbb
ccc
ddd
eee
fff
</textarea>


And the original razor view code is:
@Html.TextAreaFor(model => model.Comments, new { cols = "62", rows = "10", style = "width: 99%; " })
 
Share this answer
 
v2
Comments
dharmegh 19-Feb-14 6:47am    
i am using simple asp.net and html code ..... nothing else
please check my question again ... i have updated it
Raul Iloc 19-Feb-14 7:16am    
You should provide your ASP.NET (HTML) code.
Then the C# code used to save and set the value in the field. Maybe I will could see some error in your code!
dharmegh 19-Feb-14 7:33am    
wait

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900