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
"
));
}
}
查看全文
相关阅读:
短信发送流程
aidl
tail
RIL层传输的方式就是socket
adb s <设备> <命令>
Shell
你好,色彩 android:background="@color/white" [create file color.xml at res/values/]
[C#]在C#中使用NUnit进行单元测试
[ASP.NEt] IE6布署NET网站时,Oracle 抛出异常
[ASP.NET]如何Response.Redirect新的页面到指定的框架中(原创)
原文地址:https://www.cnblogs.com/puke/p/768664.html
最新文章
访问母版页控件、属性、方法及母版页中调用内容页的方法
制作带启动菜单的安装光盘
window.open参数完全手册
C#对SQL Server常见操作
Microsoft.Office.Interop.Excel”不能用 操作excel
C#操作INI文件(我的处女作啊)
判断输入的内容是否为数字
读取USB设备的描述符
LIBUSB 介绍
Windows 7 工行老版金邦达U盾安装解决方案
热门文章
USB HID 设备类协议入门
用VS编译出可独立运行的程序
USB设备描述符完全解析
sscanf函数用法详解
STM32 USBHID通信移植步骤
SIM300命令参考
GPRS模块SIM300的使用
DataSetObserver猜想观察者模式
C++ Primer 第三章 标准库类型
从瘦高到矮胖
Copyright © 2011-2022 走看看