hof*_*lie 4 asp.net encoding asynchronous ajaxcontroltoolkit html-editor
我正在使用标准的HTMLEditorExtender控件(ajax控件工具包的一部分).在原始的pageLoad中,我用html填充它(包括> p <,> br <,> strong <和> img <tags.它在HTMLEditorExtender控件中显示正常.然后,当我执行异步回发(通过updatepanel)时,所有> img <标签显示为实际的html而不是显示图像.所有其他标签仍然正确显示.
异步回发后HTMLEditorExtender控件的标记如下:在用于保存html编码值的不可见textarea中,正确显示的所有标签都正常编码(即<和>),但img标签省略了&符号在编码值之前(即lt;和gt;)
更新:如果我将此代码放在我的pageLoad事件中,它工作正常,但我担心这有什么安全隐患?
if (IsPostBack)
{
txtBookingConfirmation.Text = Server.HtmlDecode(txtBookingConfirmation.Text);
}
Run Code Online (Sandbox Code Playgroud)
任何人都可以告诉我如何防止控制这样做?
提前致谢
这似乎是唯一的解决方案,并没有给出任何问题.
if (IsPostBack)
{
txtBookingConfirmation.Text = Server.HtmlDecode(txtBookingConfirmation.Text);
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2376 次 |
| 最近记录: |