开发者

What is Server.HtmlEncode()?

What is the difference between using and not using Server开发者_开发问答.HtmlDecode()?

For example:

txtLocation.Text = Server.HtmlDecode(awardShowYear.ShowLocation);
txtLocation.Text = awardShowYear.ShowLocation;

What is the difference between those two lines of code?


The first one:

txtLocation.Text = Server.HtmlDecode(awardShowYear.ShowLocation);

Will remove any HTML-Encoding from the string and assign the decoded result to the txtLocation.Text.

The second one:

txtLocation.Text = awardShowYear.ShowLocation;

Will simply assign the string to txtLocation.Text, preserving any HTML encoding that is present.

See HttpServerUtility.HtmlDecode Method (String)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜