Tuesday, March 24, 2009

Replace enter key value
from textbox using asp.net with c#.net and save in database

Problem: when I wants save multiline textbox value in database using asp.net with c#.net and show as it is its not happening ....
Actually the problem is when we enter the value in textbox and press enter key. value like this
this is dilip
web developer
it save in database but when fetch value from database its showing in same line like this: this is dilip web developer

solution: string txtvalue = mytextbox.Text.ToString().Replace("\r\n", "
");
and save it.
Because enter key value is \r\n . and now it will show as u entered text

No comments: