You can use the HttpUtility.HtmlDecode Method to remove the encoding.
How to disable the Textbox's text encoding before saving it into the data base?
-
29-03-2022 - |
Question
I entered the text "J&K"(Without Cotes) in my StateCode textbox and saved it into database(SqlServer). But it saved as J & amp; K. So m not able to fetch the data saved, with J&K(Primery key). How can I disable encoding of text before saving it to database?
Solution
OTHER TIPS
Use Server.HtmlEncode("YourTextWith<and>Characters")
for this activity.
wrap your output text within it.
Or,
This can also be helpfull>>
System.Web.UI.HtmlControls.HtmlTextArea textBox = new System.Web.UI.HtmlControls.HtmlTextArea();
textBox.Value = "j&k";
Hope its helpful.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow