Handle Bad characters
-
Hi I'm having web application connect with sql dbase. When i read data from database and render it to textbox control i used HttpUtility.HtmlDecode to render it, but there is windows application and it also try to render to same value it render as "&" (exact value in database). how can i solve this issue, is there standard way to overcome this issue? 1 . Do i need decode in windows application as well? 2. Is it good to show encode value in web application text box (&)?
-
Hi I'm having web application connect with sql dbase. When i read data from database and render it to textbox control i used HttpUtility.HtmlDecode to render it, but there is windows application and it also try to render to same value it render as "&" (exact value in database). how can i solve this issue, is there standard way to overcome this issue? 1 . Do i need decode in windows application as well? 2. Is it good to show encode value in web application text box (&)?
I HTML encode HTML before I store it in a database column, and then decode if I need the HTML to be decoded. It took me some years to figure it out after trial and error and various scenarios that came up. Those ampersands for example in AT&T can be quite annoying. Maybe others do it different.