c# - ASP.NET saving text to database in correct format -
i have asp.net 4.5 text box 5 rows. when save below data table not take in consideration there line breaks.
example:
hello name mike! how you?
please can help?
when saving data table of course save below , displayed again if populate website value.
hello name mike!how you?please can help?
but want displayed line breaks way written in first place.
the thing is, not want make use of custom form item because user able copy , paste html website in , not want that.
any idea how can done without using plugin such below user able copy , paste data into?
to populate text box database try;
textbox1.text = sometext.replace("\r\n", environment.newline)
for label
label1.text = sometext.replace("\r\n", <br />)
alternatively save data database
sometext = textbox1.text.replace("\r\n", "<br />")
although approach may not appropriate if database used elsewhere.
Comments
Post a Comment