Hello, I have a text field which hold a whole body of an Article. When I display this field using DataList, it becomes 1 paragraph. Seems like the 'enter' key disappear.
In classic ASP, I have this function to resolve that.
<%
Function PrepForHtml (strDirty)
Dim strClean
If IsNull(strDirty) OR Trim(strDirty) = "" Then
PrepForHTML = ""
Exit Function
End If
strClean = Trim(strDirty)
strClean = Replace(strClean, "<", "<", 1, -1 , 1)
strClean = Replace(strClean, ">", ">", 1, -1 , 1)
strClean = Replace(strClean, Chr(10), "<br>", 1, -1, 1)
PrepForHtml = strClean
End Function
%>
How would I do the same thing in ASP.NET?
Thanks,
Andel
In classic ASP, I have this function to resolve that.
<%
Function PrepForHtml (strDirty)
Dim strClean
If IsNull(strDirty) OR Trim(strDirty) = "" Then
PrepForHTML = ""
Exit Function
End If
strClean = Trim(strDirty)
strClean = Replace(strClean, "<", "<", 1, -1 , 1)
strClean = Replace(strClean, ">", ">", 1, -1 , 1)
strClean = Replace(strClean, Chr(10), "<br>", 1, -1, 1)
PrepForHtml = strClean
End Function
%>
How would I do the same thing in ASP.NET?
Thanks,
Andel