带有图像的RadioButtonList在回发时引发XXS错误
本文关键字:XXS 错误 图像 RadioButtonList | 更新日期: 2024-07-10 18:51:05
我已经通过以下代码将图像添加到单选按钮中
themeRadioButtonList.Items.Add(
new ListItem(String.Format("<img src='ThemeImages/blue.png'>","fsd")));
themeRadioButtonList.Items.Add(
new ListItem(String.Format("<img src='ThemeImages/green.png'>")));
themeRadioButtonList.Items.Add(
new ListItem(String.Format("<img src='ThemeImages/red.png'>")));
工作良好。然而,由于html提供了一个跨侧脚本警告。不管怎么说?
您可以尝试使用:
themeRadioButtonList.Items.Add(
new ListItem(String.Format("<img src='{0}'>", "ThemeImages/blue.png") ,"fsd"));
themeRadioButtonList.Items.Add(
new ListItem(String.Format("<img src='{0}'>", "ThemeImages/green.png") ));
themeRadioButtonList.Items.Add(
new ListItem(String.Format("<img src='{0}'>", "ThemeImages/red.png") ));