سؤال

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?

هل كانت مفيدة؟

المحلول

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

نصائح أخرى

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.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top