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?

Was it helpful?

Solution

You can use the HttpUtility.HtmlDecode Method to remove the encoding.

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
scroll top