0

我设法通过以下代码将图像添加到单选按钮

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 提供了跨侧脚本警报。无论如何围绕这个?

4

1 回答 1

0

你可以尝试:

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") ));
于 2012-07-25T08:13:55.447 回答