此HTML标签<input />可完全取代以上2个服务器控件。
RadioButtonList及RadioButton依赖于form窗体,产生很多垃圾代码,有时候只是用来显示此方法可取代。
aspx:
  <input type="radio" name="radio" />
  <label for="test1">同意</label>
  <input type="radio" name="radio" />
  <label for="test2">不同意</label>
cs:
if (strismk == "1") this.test1.Checked = true;
if (strismk == "2") this.test2.Checked = true;

如此可产生干净的页面代码. 

补充:如果项目很多的时候,name="radio"一定要改名,name="radio1",name="radio2",虽然页面代码里已经选上,可页面上看不到选上的迹象。

其他浏览器没有什么问题,发现Firefox中不能选中,一定要有name值才可以选中。

除了开放调试程序外,Firefox真的是一无是出,启动速度超慢,很多东西不兼容。 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-06-03
  • 2021-07-27
  • 2021-08-27
  • 2022-12-23
  • 2021-10-16
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-30
  • 2022-01-06
  • 2021-12-05
  • 2022-01-11
相关资源
相似解决方案