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. Advertising

  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. Advertising

  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. Advertising

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,639
  2. Joe Wright
    Replies:
    0
    Views:
    500
    Joe Wright
    Jul 27, 2003
  3. WuyaSea Operator
    Replies:
    48
    Views:
    1,441
    Ben Phillips
    Sep 24, 2007
  4. Lew
    Replies:
    0
    Views:
    399
  5. haomiao

    Why stdin lose after new Thread

    haomiao, Jul 26, 2008, in forum: Perl Misc
    Replies:
    1
    Views:
    124
Loading...

Share This Page