手机
当前位置:查字典教程网 >编程开发 >asp.net教程 >asp.net使用jQuery获取RadioButtonList成员选中内容和值示例
asp.net使用jQuery获取RadioButtonList成员选中内容和值示例
摘要:复制代码代码如下:$(document).ready(function(){$("#input[type=radio]").bind("ch...

复制代码 代码如下:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Web.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>

<script src="jquery-1.8.2.min.js" type="text/javascript"></script>

<link href="Base.css" rel="stylesheet" type="text/css" />

<style type="text/css">

</style>

<script type="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>

<form id="form1" runat="server">

<div>

<fieldset>

<p>

请选择爱好</p>

<asp:RadioButtonList ID="rblHobbies" runat="server" >

<asp:ListItem Value="1">音乐</asp:ListItem>

<asp:ListItem Value="2">篮球</asp:ListItem>

<asp:ListItem Value="3">美剧</asp:ListItem>

<asp:ListItem Value="4">电影</asp:ListItem>

</asp:RadioButtonList >

</fieldset>

<br />

<div id="message"></div>

</div>

</form>

</body>

</html>

【asp.net使用jQuery获取RadioButtonList成员选中内容和值示例】相关文章:

asp.net中调用winrar实现压缩解压缩的代码

asp.net 设置GridView的选中行

jQuery来获取RadioButtonList成员内容的方法

asp.net 获取图片高度和宽度实例代码

.net获取本机公网IP地址示例

asp.net实现在线音乐播放器示例

Asp.Net如何将多个RadioButton指定在一个组中

asp.net Repeater中使用if的代码

使用ajax局部刷新gridview进行数据绑定示例

asp.net 文章内容分页显示的代码

精品推荐
分类导航