simple one..... from HTML to SQL to HTML... i lose my new lines

Discussion in 'ASP .Net' started by Justin Rich, Jun 14, 2005.

  1. Justin Rich

    Justin Rich Guest

    Im not sure where i lose the new line stuff but when i pull it back from the
    DB its gone.

    Im using the SQLDataSource control. i pull it and push to a asp:textbox.

    i assume there is something simple i need to do?
     
    Justin Rich, Jun 14, 2005
    #1
    1. Advertisements

  2. Justin,

    I believe that a simple replace statement should solve your problems.
    If I am not mistaken, it is stored in SQL as Chr(13). You should be
    able to do a replace command and replace the Chr(13) with a <BR> tag.

    Let me know if this helps. I know the following is what is used when a
    datagrid is populated:

    <asp:TemplateColumn HeaderText="myField" Visible="True">
    <ItemTemplate>
    <%# myDataSet.FieldValue("myField", Container).
    Replace(Chr(13), "<br>") %>
    </ItemTemplate>
    </asp:TemplateColumn>

    Aaron
     
    Aaron Corcoran, Jun 14, 2005
    #2
    1. Advertisements

  3. Justin Rich

    Justin Rich Guest

    FieldValue is not part of a SQLDataSource.
    also what namespace is the Chr function in?

    Thanks
    Justin

    "Aaron Corcoran" <> wrote in message
    news:...
    > Justin,
    >
    > I believe that a simple replace statement should solve your problems.
    > If I am not mistaken, it is stored in SQL as Chr(13). You should be
    > able to do a replace command and replace the Chr(13) with a <BR> tag.
    >
    > Let me know if this helps. I know the following is what is used when a
    > datagrid is populated:
    >
    > <asp:TemplateColumn HeaderText="myField" Visible="True">
    > <ItemTemplate>
    > <%# myDataSet.FieldValue("myField", Container).
    > Replace(Chr(13), "<br>") %>
    > </ItemTemplate>
    > </asp:TemplateColumn>
    >
    > Aaron
    >
     
    Justin Rich, Jun 15, 2005
    #3
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jack
    Replies:
    9
    Views:
    2,928
  2. jakester
    Replies:
    3
    Views:
    2,154
    jakester
    Apr 3, 2007
  3. WuyaSea Operator
    Replies:
    48
    Views:
    1,792
    Ben Phillips
    Sep 24, 2007
  4. ecoolone
    Replies:
    0
    Views:
    957
    ecoolone
    Jan 3, 2008
  5. Robin Wenger
    Replies:
    11
    Views:
    4,082
  6. Ciba LO
    Replies:
    4
    Views:
    392
    Ciba LO
    Jul 8, 2006
  7. haomiao

    Why stdin lose after new Thread

    haomiao, Jul 26, 2008, in forum: Perl Misc
    Replies:
    1
    Views:
    217
  8. Replies:
    2
    Views:
    796
    Thomas 'PointedEars' Lahn
    Mar 11, 2008
Loading...