Last post Aug 08, 2009 07:23 AM by ganesh_dabhade
Jul 31, 2009 11:01 AM|ganesh_dabhade|LINK
I m using VS 2005. I m using gridview to show data from database (Access).
I want to show a Memo fields in a label control.
I cant use label because I do not shows ENTERs. It shows the text in continuous lines. I used the following code...
Public Function FixCrLf(ByVal value As String) As String If String.IsNullOrEmpty(value) Then Return String.Empty Return value.Replace(Environment.Newline, "<br />") End Function
This works in VS2008 Exp. But not in VS2005
Please help solve this problem.....
Thx in advance...
Jul 31, 2009 12:22 PM|aderegil|LINK
Can you post a sample of the rendered text? I cannot think of any difference between VS2005 and VS2008 because this is something related to the HTML not to the IDE.
Also, why don't you try with a Literal control instead of a Label control. A label is rendered as a DIV in HTML. A literal is rendered exactly as you set it.
Aug 01, 2009 04:21 AM|Mikesdotnetting|LINK
A label is rendered as a DIV in HTML
It's actually a <span>, Panels render as divs.
Aug 04, 2009 06:07 PM|aderegil|LINK
Mikesdotnetting: You are right, <asp:Label renders a <span html tag.
ganesh_dabhade: Have you solved your problem? Can we close this question then please?
Or you can give us more feedback about your problem?
Aug 08, 2009 07:23 AM|ganesh_dabhade|LINK
How stupid I was?
I was calling the function from EditItemTemplate instead of ItemTemplate.
It was my mistake.
Problem is solved..