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

推荐订阅源

Martin Fowler
Martin Fowler
WordPress大学
WordPress大学
S
SegmentFault 最新的问题
罗磊的独立博客
Apple Machine Learning Research
Apple Machine Learning Research
The Cloudflare Blog
L
LangChain Blog
博客园 - 司徒正美
G
Google Developers Blog
博客园 - 【当耐特】
GbyAI
GbyAI
月光博客
月光博客
人人都是产品经理
人人都是产品经理
D
DataBreaches.Net
大猫的无限游戏
大猫的无限游戏
A
About on SuperTechFans
Microsoft Azure Blog
Microsoft Azure Blog
V
Visual Studio Blog
D
Docker
MongoDB | Blog
MongoDB | Blog
Vercel News
Vercel News
Stack Overflow Blog
Stack Overflow Blog
Jina AI
Jina AI
博客园 - 聂微东

博客园 - 景天

[转]mysql sql 百万级数据库优化方案 left outer join Ext.extend 【转】C#中文排序(拼音和笔画) Ext中Checkbox的注意事项 - 景天 - 博客园 表单从服务器端读取 [转]关于project2003中几个视图的认识 Oracle 常用数据字典、外键查询 Oracle 10 回收站 C++ 字符串替换 ASP.NET MVC beta 模板(Templates) 中文修正补丁 完整版 Oracle备份数据库的脚本 Oracle10g常用命令 和 常用函数 Oracle 10g 笔记1 连接和SQL编写 .NET调用Oracle存储过程,使用数组类型的参数(如ArrayList) Oracle 存储过程 及 .net 调用 按钮事件 直接下载 任何文件格式 ASP.NET MVC beta 中文模板修正补丁 IE7\IE6 图片上传预览 - 景天 - 博客园
RadioButtonList的选择确认
景天 · 2008-11-28 · via 博客园 - 景天

RadioButtonList的选择确认~!

不说废话,看代码~!

        protected void Page_Load(object sender, EventArgs e)
        {
            
this.RadioButtonList1.Items[1].Attributes.Add("onclick""if(!confirm('您真的要点我吗?')){document.getElementById('" + this.RadioButtonList1.ClientID+ "_0').checked=true;event.returnValue=false;}");

        }

Default.aspx

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication5._Default" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" ><head runat="server">
    
<title>无标题页</title></head><body>
    
<form id="form1" runat="server">
    
<div>
        
<asp:RadioButtonList ID="RadioButtonList1" runat="server">
            
<asp:ListItem Selected="True">1</asp:ListItem>
            
<asp:ListItem>2</asp:ListItem>
        
</asp:RadioButtonList>
    
</div>
    
</form>
</body>
</html>