Click here to Skip to main content
15,901,001 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
Textbox return #39; for ' (single code) in asp.net. i want ' (single code) not #39; in my textbox. Can any one tells this solution.
Posted
Comments
Sergey Alexandrovich Kryukov 12-Mar-12 4:51am    
Please stop doing it. I already warned you about those question, now I've reported it as spam.
--SA
Richard MacCutchan 12-Mar-12 8:46am    
Why is this spam; it looks like a perfectly reasonable question to me.
Sergey Alexandrovich Kryukov 12-Mar-12 13:06pm    
I would be glad to be mistaken if you find it reasonable, but it is a kind of spam just because it is repeated several times.
--SA
Richard MacCutchan 12-Mar-12 13:31pm    
It appears his account has been disabled so I cannot check, but I only saw one repeat of the question, which looked like a genuine mistake. I think you need to allow some of these newcomers a bit more leeway before having them thrown off the site.
Sergey Alexandrovich Kryukov 13-Mar-12 0:39am    
I agree, but I did not throw any of them from the site, in fact. I removed couple of identical questions before. As far as I remember, OP had four in total, or so. At least agree that we don't need identical questions from the same OP.
--SA

I guess your textbox is getting a URI that has already been expanded to replace the special characters with their control equivalents. I think you may find the Uri.Unescape()[^] method may help you.
 
Share this answer
 
Use it 
txtBox.Text = System.Web.HttpUtility.HtmlEncode("This is my \"text\", isn't it pretty?");
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900