zoukankan
html css js c++ java
GridView中的Radio
1.html
<
html
xmlns
="http://www.w3.org/1999/xhtml"
>
<
head
runat
="server"
>
<
title
>
GridView中的Radio
</
title
>
</
head
>
<
body
>
<
form
id
="form1"
runat
="server"
>
<
div
>
<
asp:GridView
ID
="GridView1"
Width
="100%"
runat
="server"
AutoGenerateColumns
="false"
>
<
Columns
>
<
asp:TemplateField
>
<
HeaderTemplate
>
单选
</
HeaderTemplate
>
<
ItemTemplate
>
<
input
type
="radio"
id
="RadioName"
name
="RadioName"
value
='<%#
Eval("au_id")%
>
'/>
</
ItemTemplate
>
</
asp:TemplateField
>
<%
--<
asp:BoundField DataField
=
"
au_id
"
HeaderText
=
"
au_id
"
/>--
%>
<
asp:BoundField
DataField
="au_lname"
HeaderText
="au_lname"
/>
<
asp:BoundField
DataField
="au_fname"
HeaderText
="au_fname"
/>
<
asp:BoundField
DataField
="phone"
HeaderText
="phone"
/>
<
asp:BoundField
DataField
="address"
HeaderText
="address"
/>
</
Columns
>
</
asp:GridView
>
<
asp:Button
ID
="Button1"
runat
="server"
Text
="显示"
OnClick
="Button1_Click"
/></
div
>
</
form
>
</
body
>
</
html
>
2.cs
using
System;
using
System.Data;
using
System.Configuration;
using
System.Collections;
using
System.Web;
using
System.Web.Security;
using
System.Web.UI;
using
System.Web.UI.WebControls;
using
System.Web.UI.WebControls.WebParts;
using
System.Web.UI.HtmlControls;
public
partial
class
GridView_GridView_Radio : System.Web.UI.Page
{
Practice.DAL.authors authorsbll
=
new
Practice.DAL.authors();
protected
void
Page_Load(
object
sender, EventArgs e)
{
if
(
!
IsPostBack)
{
DataBindGridView();
}
}
/**/
///
<summary>
///
功 能:绑定GridView
///
作 者:PUKE
///
完成时间:2007-05-18
///
版 权:pukesys@tom.com
///
</summary>
private
void
DataBindGridView()
{
DataSet ds
=
authorsbll.GetList(
""
);
GridView1.DataSource
=
ds;
GridView1.DataBind();
}
/**/
///
<summary>
///
功 能:Button1的Click,获得选中的数据的id值
///
作 者:PUKE
///
完成时间:2007-05-18
///
版 权:pukesys@tom.com
///
</summary>
///
<param name="sender"></param>
///
<param name="e"></param>
protected
void
Button1_Click(
object
sender, EventArgs e)
{
Response.Write(Request.Form.Get(
"
RadioName
"
));
}
}
查看全文
相关阅读:
ubuntu如何设置dns?
docker服务无法启动如何处理?
yocto编译时报错"fontconfig-2.12.1/src/fcmatch.c:324:63: error: ‘PRI_CHAR_WIDTH_STRONG' undeclared here (not in a function); did you mean ‘PRI_WIDTH_STRONG’?"
git如何将当前仓库的远程分支推到一个新的仓库中?
linux下如何制作ubuntu系统启动盘(sd)?
yocto编译时报错"glibc/locale/xlocale.h:39:4: note: previous declaration of '__locale_t' was here"
19、异常处理
18、文件与目录
17、python对内存的使用
16、正则表达式
原文地址:https://www.cnblogs.com/puke/p/768664.html
最新文章
在线API文档管理工具Simple doc
Beetlex服务框架之Webapi版本访问控制
BeetleX服务网关之服务发现与泛域名路由
Beetlex服务框架之Webapi访问限制和url重写
BeetleX服务网关之限流和缓存
Bumblebee服务网关之统一请求验证
强化学习(十六) 深度确定性策略梯度(DDPG)
强化学习(十五) A3C
强化学习(十四) Actor-Critic
强化学习(十三) 策略梯度(Policy Gradient)
热门文章
强化学习(十二) Dueling DQN
强化学习(十一) Prioritized Replay DQN
强化学习(十)Double DQN (DDQN)
强化学习(九)Deep Q-Learning进阶之Nature DQN
强化学习(八)价值函数的近似表示与Deep Q-Learning
强化学习(七)时序差分离线控制算法Q-Learning
docker build时报错"failed to create endpoint xxxx on network bridge: failed to add the host (veth999999) <=> sandbox (vetha8888888) pair interfaces: operation not supported"
执行python脚本时报错"ImportError: cannot import name pkcs1_15"如何处理?
使用pip/pip3安装软件时报错"requests.exceptions.SSLError: ("bad handshake: Error([('SSL routines', 'tls_proc ess_server_certificate', 'certificate verify failed')],)",)"如何处理?
dockerd -D启动docker服务时报错”Failed to program FILTER chain: iptables failed: iptables --wait -I FORWARD -o docker0 -m conntrack iptables: No chain/target/match by that name”
Copyright © 2011-2022 走看看