I have a multiline textbox.
When the user presses enter cursor moves to next line.
But when i save to database the txtmultiline.text does not show the next line and hence stored in a single line.
I google and could not find a good sample for my case.
Can you help me with a sample ?
txtmultiline.text does not show any escape string in next line.
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:TextBox ID="TextBox1" TextMode="MultiLine" runat="server"></asp:TextBox><br />
<asp:Label ID="Label1" runat="server" Text="Label"><br /></asp:Label>
<br />
<br />
<asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" />
</ContentTemplate>
</asp:UpdatePanel>
Public Class WebForm1
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
End Sub
Protected Sub Button1_Click(sender As Object, e As EventArgs)
Label1.Text = TextBox1.Text.Replace(Environment.NewLine, "<br/>")
End Sub
End Class