惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Latest news
Latest news
J
Java Code Geeks
The Register - Security
The Register - Security
V
Visual Studio Blog
IT之家
IT之家
Martin Fowler
Martin Fowler
The GitHub Blog
The GitHub Blog
B
Blog RSS Feed
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Stack Overflow Blog
Stack Overflow Blog
The Cloudflare Blog
N
Netflix TechBlog - Medium
博客园 - 聂微东
D
Docker
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园_首页
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
C
Check Point Blog
美团技术团队
爱范儿
爱范儿
A
About on SuperTechFans
Y
Y Combinator Blog
Engineering at Meta
Engineering at Meta
PCI Perspectives
PCI Perspectives
MyScale Blog
MyScale Blog
T
Threatpost
S
Securelist
量子位
C
Cyber Attacks, Cyber Crime and Cyber Security
Vercel News
Vercel News
宝玉的分享
宝玉的分享
Project Zero
Project Zero
S
Security @ Cisco Blogs
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Cisco Talos Blog
Cisco Talos Blog
罗磊的独立博客
M
MIT News - Artificial intelligence
雷峰网
雷峰网
G
Google Developers Blog
T
The Blog of Author Tim Ferriss
Google Online Security Blog
Google Online Security Blog
The Last Watchdog
The Last Watchdog
P
Proofpoint News Feed
Security Archives - TechRepublic
Security Archives - TechRepublic
Schneier on Security
Schneier on Security
H
Hacker News: Front Page
T
Troy Hunt's Blog
U
Unit 42
Scott Helme
Scott Helme

博客园 - ★金★

导出EXCEL table变宽格式 IE11兼容性设定 C#获取多个相同name值 DIV左右行 Jquery绑定Select下拉菜单 SQL中多项合并时请加ISNULL Repeater中绑定下拉菜单的2种方法 WebForm设置URL路由后要照顾好之前的连接 Repeater中获取HTML select 值 NPOI生成Excel 博文阅读密码验证 - 博客园 Firefox中不支持parentElement用parentNode取代 jquery给span赋值的时候出现firefox不兼容 jquery表单验证增加确认及可选不需要验证的方法 javascript可用数组取代case格式化字符 display和visibility的区别 SQL中Replace替换引号 javascript动态添加删除行后行内计算及取值
取代RadioButtonList及RadioButton方法
★金★ · 2011-03-02 · via 博客园 - ★金★

此HTML标签<input id="Radio1" type="radio"/>可完全取代以上2个服务器控件。

RadioButtonList及RadioButton依赖于form窗体,产生很多垃圾代码,有时候只是用来显示此方法可取代。

aspx:

  <input type="radio" name="radio" id="test1" value="1" disabled="disabled" runat="server"/>

  <label for="test1">同意</label>

  <input type="radio" name="radio" id="test2" value="2" disabled="disabled" runat="server"/>

  <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真的是一无是出,启动速度超慢,很多东西不兼容。