首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >回发时出现图像抛出XXS错误的RadioButtonList

回发时出现图像抛出XXS错误的RadioButtonList
EN

Stack Overflow用户
提问于 2012-07-25 16:04:13
回答 1查看 148关注 0票数 0

我已经成功地通过以下代码将图像添加到单选按钮

代码语言:javascript
复制
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给出了一个交叉脚本警报。不管怎样,围绕这件事?

EN

回答 1

Stack Overflow用户

发布于 2012-07-25 16:13:55

您可以尝试使用:

代码语言:javascript
复制
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") ));
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/11645245

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档