Tag Archives: TextArea save enter value

TextArea control manage Enter,Space Character with

if you want to save your TextArea or Text with Multitextmode and you manage the Enter ,Space Character

Then you use this Function and just you pass first text box value before save.


For Html Control

Dim strMessage As String = GetMessage(HttpUtility.HtmlEncode(Trim(Request.Form(“txtAdtRmrks”))))

For SERVERĀ  Control aspx control

Dim strMessage As String= GetMessage(txtcomments.text)

Public Shared Function GetMessage(ByVal obj As Object) As String
Dim str As String = “”
Dim lbl As New HtmlGenericControl
If Not obj Is Nothing Then
str = obj.ToString
str = Replace(str, vbCrLf, “<br />”)
lbl.InnerHtml = str
Return lbl.InnerText.ToString
Return “”
End If
End Function

1 Comment

Posted by on May 17, 2011 in Vb.Net


Tags: , ,