Re: <asp:Textbox> <enter> key (CR) can't be save to a database

Discussion in 'ASP .Net' started by Cem Sisman, Mar 31, 2009.

  1. Cem Sisman

    Cem Sisman Guest

    when the save process begins, try doing this ;

    string val = textbox1.Text.replace("\r\n","<br />");

    or when you retrive the data from database ;

    textbox1.Text = dbValue.replace("\r\n","<br />");


    --

    Cem Sisman
    twitter: @cemsisman
    http://cemsisman.com


    "Gabriel" <> wrote in message
    news:...
    >I not to be able to store the carriage return from a multiline textbox
    > control on my web application.
    >
    > So when the data is displayed back from the database there are no carriage
    > return. All the lines are displayed as a single long line.
    >
    > I've check the database (MSSQL 2008) and it doesn't seem to be storing it.
    > But if I save the information from a textbox using a winform everything is
    > stored correctly.
    >
    > Does anyone have any suggestions to help me solve this problem?
    >
    > I am using Visual Studio 2008. C# in a web application running from IIS
    > 6.0
    >
    > Thanks.
    Cem Sisman, Mar 31, 2009
    #1
    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. Gabriel
    Replies:
    2
    Views:
    1,376
    Gabriel
    Mar 31, 2009
  2. Karen Grube

    Urgent: How can I get the enter key to behave like a tab key?

    Karen Grube, Nov 28, 2004, in forum: ASP .Net Web Controls
    Replies:
    3
    Views:
    289
    Karen Grube
    Nov 29, 2004
  3. BrianDH

    Enter Key H*ll, control enter key submit button

    BrianDH, Jan 12, 2005, in forum: ASP .Net Web Controls
    Replies:
    3
    Views:
    371
    Anders Matthiessen
    Jan 12, 2005
  4. M P
    Replies:
    1
    Views:
    454
  5. HopfZ
    Replies:
    0
    Views:
    538
    HopfZ
    Aug 28, 2006
Loading...

Share This Page