And is there any way to do it without freetext box, because I dont need anything that complex just something that will read paragraphs and spaces correctly. No richtext formating is required.
Main Topics
Browse All TopicsHi all
I have a Textfield that allows the user to enter in paragraphs of information to a database, this information is then read back out of the database using a Repeater. I was wondering is it possible to format the data so it is exaxtly as the user entered it in. I was told HTML Encode would do the job
but how would I actually encode the data
This is how I currently doing it:
string str = Server.HtmlEncode( Comments.Text.Replace( "'", "''" ));
and inserting into the database using this:
cmd.CommandText = String.Format("Insert INTO forum (userId,forumTitle,country
So that will enter in the data, Im simply inserting str, which I encoded above. Is this correct?
Next up Is getting this infor back out of the database?
Do I need to use HTML Decode? and how on earth do I decode the data, if Im putting it straigt into a dataset?
Cheers for the help..
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
The following post might be helpful:
http://www.experts-exchang
Best, Nauman.
fallenarmies ,
You need to turn off validateRequest property before you try to use Server.HtmlEncode inside your web site otherwise you'll get trouble on it.
This link give you more definations about it :
http://asp.net/faq/Request
Use Server.HtmlEncode before store your data into your db, then use Server.HtmlDecode to revert html into your textarea.
fallenarmies ,
I got to convert my head from vb.net to c#. Sorry if i got make any mistake there.
here is the conversion : http://www.netcoole.com/VB
Cool now finally one minor problem
When I view the entry, I have a small summary of each entry. But I have the summary limited to 255 characters, the problem is that When I have a all the <BR> in it does read them.
Another problem is that when they dont enter a return or space it picks it up as one big string is it possible to limit the number of characters before it goes to the next line?
fallenarmies,
>>When I view the entry, I have a small summary of each entry. But I have the summary limited to 255 characters, the problem is that When I have a all the <BR> in it does read them.
-You mean your summary data type=255 characters(maximum)?The rest of the text is concat?
>>Another problem is that when they dont enter a return or space it picks it up as one big string is it possible to limit the number of characters before it goes to the next line?
-you can use javascript to prevent user to enter text before user press enter after certain limit of characters. You can get a good answer at Javascript area about this request.
Business Accounts
Answer for Membership
by: razoPosted on 2004-09-15 at 06:25:26ID: 12064326
what u would want to do is to use a richtetbox that would transform the data into html
u save the html in ur databse
then u use a literal to view data
try using www.freetextbox.com
if u need specific example dont hesitate to ask