zoukankan
html css js c++ java
一个取得数据控件模板中输入框值的类
GetEdit.cs
using
System;
using
System.Data;
using
System.Configuration;
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;
using
System.Data.SqlClient;
using
System.Web.UI.MobileControls;
/**/
///
<summary>
///
GetEdit 的摘要说明
///
</summary>
public
class
GetEdit
{
private
static
int
RowsIndex;
public
GetEdit()
{
}
/**/
///
<summary>
///
取GridView中TextBox中的值
///
</summary>
//
按钮上设置属性 CommandArgument='<%# ((GridViewRow) Container).RowIndex %>'
//
int RowsIndex = Convert.ToInt32(e.CommandArgument);
public
static
string
GetGridView_TextBox(GridView GridViewID,
string
TextBoxID,
int
RowsIndex,
int
CellIndex)
{
return
((System.Web.UI.WebControls.TextBox)GridViewID.Rows[RowsIndex].Cells[CellIndex].FindControl(TextBoxID)).Text;
}
public
static
string
GetGridView_TextBox(GridView GridViewID,
string
TextBoxID, GridViewCommandEventArgs e,
int
CellIndex)
{
RowsIndex
=
Convert.ToInt32(e.CommandArgument);
return
((System.Web.UI.WebControls.TextBox)GridViewID.Rows[RowsIndex].Cells[CellIndex].FindControl(TextBoxID)).Text;
}
/**/
///
<summary>
///
取GridView中HiddenField中的值
///
</summary>
public
static
string
GetGridView_HiddenField(GridView GridViewID,
string
HiddenFieldID,
int
RowsIndex,
int
CellIndex)
{
return
((System.Web.UI.WebControls.HiddenField)GridViewID.Rows[RowsIndex].Cells[CellIndex].FindControl(HiddenFieldID)).Value;
}
public
static
string
GetGridView_HiddenField(GridView GridViewID,
string
HiddenFieldID, GridViewCommandEventArgs e,
int
CellIndex)
{
RowsIndex
=
Convert.ToInt32(e.CommandArgument);
return
((System.Web.UI.WebControls.HiddenField)GridViewID.Rows[RowsIndex].Cells[CellIndex].FindControl(HiddenFieldID)).Value;
}
/**/
///
<summary>
///
取DataList中TextBox中的值
///
</summary>
public
static
string
GetDataList_TextBox(DataList DataListID,
string
TextBoxID, DataListCommandEventArgs e)
{
return
((System.Web.UI.WebControls.TextBox)DataListID.Items[e.Item.ItemIndex].FindControl(TextBoxID)).Text;
}
/**/
///
<summary>
///
取DataList中HiddenField中的值
///
</summary>
public
static
string
GetDataList_HiddenField(DataList DataListID,
string
HiddenFieldID, DataListCommandEventArgs e)
{
return
((System.Web.UI.WebControls.HiddenField)DataListID.Items[e.Item.ItemIndex].FindControl(HiddenFieldID)).Value;
}
/**/
///
<summary>
///
取Repeater中TextBox中的值
///
</summary>
public
static
string
GetRepeater_TextBox(Repeater RepeaterID,
string
TextBoxID, RepeaterCommandEventArgs e)
{
return
((System.Web.UI.WebControls.TextBox)RepeaterID.Items[e.Item.ItemIndex].FindControl(TextBoxID)).Text;
}
/**/
///
<summary>
///
取Repeater中HiddenField中的值
///
</summary>
public
static
string
GetRepeater_HiddenField(Repeater RepeaterID,
string
HiddenFieldID, RepeaterCommandEventArgs e)
{
return
((System.Web.UI.WebControls.HiddenField)RepeaterID.Items[e.Item.ItemIndex].FindControl(HiddenFieldID)).Value;
}
/**/
///
<summary>
///
取FormView中HiddenField中的值
///
</summary>
public
static
string
GetFormView_TextBox(FormView FormViewID,
string
TextBoxID)
{
return
((System.Web.UI.WebControls.TextBox)FormViewID.FindControl(TextBoxID)).Text;
}
/**/
///
<summary>
///
取FormView中TextBox中的值
///
</summary>
public
static
string
GetFormView_Hidden(FormView FormViewID,
string
TextBoxID)
{
return
((System.Web.UI.WebControls.HiddenField)FormViewID.FindControl(TextBoxID)).Value;
}
}
查看全文
相关阅读:
移动端前端开发调试
webkit图片滤镜
ruby安装sass报错解决办法
mongodb的查询语句学习摘要
signedCookies
[cookie篇]从cookie-parser中间件说起
node.js下mongoose简单操作实例
在ExpressJS中设置二级域名跨域共享Cookie
Node.js开发工具、开发包、框架等总结
hibernate框架学习笔记4:主键生成策略、对象状态
原文地址:https://www.cnblogs.com/yeagen/p/1332205.html
最新文章
使用bat命令实现拖动快速安装APK包
移动弱网测试方案Network Emulator for Windows Toolkit
PyInstaller打包python脚本
Python subprocess.Popen中communicate()和wait()区别
测试人员,你的价值不是你的工资
python(或BAT脚本)自动执行adb shell以后的命令
Python Unicode与中文处理
uncompyle2反编译python的.py文件
设置CMD默认代码页为65001或936
Cygwin访问盘符、使用别名、彩色显示、使用adb命令
热门文章
Mysql,删除重复项,只保留一条数据。
PyTorch批训练
DEDE网站数据快速迁移 数据库备份和还原
修改实现打开DedeCms时不跳转至index.html页面
dedecms的整合各大搜索引擎实多功能搜索框的方法
解决dede封面模板不能显示副栏目内容的问题
不在同一个服务器里的dede数据库之间数据调用方法
Dedecms5.7列表显示TAG标签带链接的方法
织梦dedecms自带采集器的高阶技巧
dedecms网站地图生成小技巧
Copyright © 2011-2022 走看看