Asp.Net Repeater中使用Button控件并响应单击操作的方法
来源:互联网 发布:肉牛屠宰软件 编辑:程序博客网 时间:2024/05/20 05:04
- HTML code
- <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %><!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"> <asp:Repeater runat="server" iD="rptTest"> <itemtemplate> <div> <asp:TextBox id="txt" text='<%# Container.DataItem.ToString() %>' runat="server" /> <asp:Button id="btn" text="提交" onclick="TestBtn" runat="server" /> </div> </itemtemplate> </asp:Repeater> </form></body></html>
- C# code
- protected void Page_Load(object sender, EventArgs e) { if (!this.IsPostBack) { string[] s = new string[] { "1", "2", "3", "4", "5" }; this.rptTest.DataSource = s; this.rptTest.DataBind(); } } protected void TestBtn(object sender, EventArgs e) { Button bt = sender as Button; RepeaterItem ri = bt.Parent as RepeaterItem; TextBox tx = ri.FindControl("txt") as TextBox; if (!object.Equals(tx, null)) { Response.Write(tx.Text); } }
- Asp.Net Repeater中使用Button控件并响应单击操作的方法
- asp.net 中repeater控件的使用
- asp.net 中repeater控件的使用
- asp.net 中repeater控件的使用
- ASP.NET Repeater控件的嵌套使用
- asp.net 中 Repeater嵌套使用的方法
- Asp.Net 文本框按回车键响应按钮单击操作的方法
- asp.net中使用分页控件,并绑定数据到GridView或Repeater
- asp.net中Repeater嵌套绑定的方法(使用两个Repeater做子类别绑定)
- asp.net中Repeater嵌套绑定的方法(使用两个Repeater做子类别绑定)
- ASP.NET(C#)--Repeater中生成“序号”列&&给Repeater控件里添加序号的5种方法
- .net中repeater控件使用
- 循环遍历asp.net repeater控件的方法
- 关于Android中ExpandableListView子项是Button控件而单击事件没有响应的问题
- asp.net Repeater控件用法----一列数据在Repeater中每行显示固定记录方法
- asp.net中repeater控件的嵌套和实现分页
- asp.net前台调用后台方法(或asp.net中Repeater控件绑定后台方法)
- asp.net控件用法--在Repeater中嵌套使用Repeater
- SQL*PLUS命令的使用大全
- 为何要用_beginthreadex()而非CreateThread?
- C#复制对象的示例
- Failed to load or instantiate TagExtraInfo
- dwr基本应用2--creator="Spring"
- Asp.Net Repeater中使用Button控件并响应单击操作的方法
- 关于dbms_sql的使用
- Flex+Java连接SQLServer
- CPU 测速(MHz)和高精度延时(微秒级)
- Oracle中用exp/imp命令快速导入
- Failed to create .NET Frameworks PropertyGrid component.(工程属性不显示 的解决方案)
- C#中索引器的概述
- 总结常用JavaScript语法107条
- 值得深思:互联网特性决定网络编辑的弱项