asp.net使用jQuery获取RadioButtonList成员选中内容和值示例
2023-06-13 09:15:15 时间
<%@PageLanguage="C#"AutoEventWireup="true"CodeBehind="Default.aspx.cs"Inherits="Web.Default"%>
<!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<htmlxmlns="http://www.w3.org/1999/xhtml">
<headrunat="server">
<title></title>
<scriptsrc="jquery-1.8.2.min.js"type="text/javascript"></script>
<linkhref="Base.css"rel="stylesheet"type="text/css"/>
<styletype="text/css">
</style>
<scripttype="text/javascript">
$(document).ready(function(){
$("#<%=rblHobbies.ClientID%>input[type=radio]").bind("change",function(){
if($(this).val()!=""){
$("#message").text("Text:"+$(this).next().text()+" Value:"+$(this).val());
}
});
});
</script>
</head>
<body>
<formid="form1"runat="server">
<divstyle="margin:100pxauto;width:400px;height:200px;">
<fieldsetstyle="width:400px;height:150px">
<p>
请选择爱好</p>
<asp:RadioButtonListID="rblHobbies" runat="server">
<asp:ListItemValue="1">音乐</asp:ListItem>
<asp:ListItemValue="2">篮球</asp:ListItem>
<asp:ListItemValue="3">美剧</asp:ListItem>
<asp:ListItemValue="4">电影</asp:ListItem>
</asp:RadioButtonList >
</fieldset>
<br/>
<divid="message"style="color:blue;"></div>
</div>
</form>
</body>
</html>
相关文章
- jquery选择器用法_jQuery属性选择器
- .NET Core如何通过认证机制访问Kafka?
- 【愚公系列】2023年02月 .NET CORE工具案例-Dapper-Extensions的使用
- 生成二维码的 jQuery 插件:jquery.qrcode.js
- .netLinux下部署ASP.NET环境指南(linux部署asp)
- .net让Oracle与ASP.NET实现无缝连接(oracleasp)
- .net搭建ASP.NET应用程序在Linux系统上(linux搭建asp)
- .net安装 Linux 上的 ASP.NET 环境(linux安装asp)
- NET与Oracle携手走向未来(.net 对oracle)
- 数据使用NET改变Oracle数据库的奥秘(net修改oracle)
- CMySQL与NET技术融会贯通(c mysql .net)
- NET备份MySQL提升数据安全性(.net 备份mysql)
- 基于NET的MySQL数据库开发实践(.net中使用mysql)
- 使用Oracle64位Net突破技术极限(oracle64位net)
- ASP.NET技巧:请求网址并解析返回的html
- asp页面和Asp.net页面传中文参数UrlEncode编码以及接收解码
- asp.net下用Aspose.Wordsfor.NET动态生成word文档中的数据表格的方法
- ASP.NET中使用后端代码注册脚本生成JQUERY-EASYUI的界面错位的解决方法
- Jquery+ajax请求data显示在GridView上(asp.net)
- 初窥JQuery-Jquery简介入门了解篇
- Jquery中getJSON在asp.net中的使用说明
- 基于jquery的文本框与autocomplete结合使用(asp.net+json)
- asp.net中js和jquery调用ashx的不同方法分享
- Jquery+asp.net后台数据传到前台js进行解析的方法
- asp.net中js+jquery添加下拉框值和后台获取示例
- asp.net中生成饼状与柱状图实例