如何在类文件中调用textbox id,gridview id .... [英] How to call textbox id, gridview id in class file....
本文介绍了如何在类文件中调用textbox id,gridview id ....的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我是.net和C#的新手...
告诉我如何从ado类文件中的源文件中调用texbox id ..
告诉我一些示例...
i'm new to .net and C#...
tell me how to call texbox id from source file in ado class file..
tell me some examples...
推荐答案
在我的下一篇文章中,您可以找到在ASP.NET中使用网格和文本框的完整示例。
高级ASPX GridView分页和数据实体 [ ^ ]
In my next article you could find a complete example of using grid and textboxes in ASP.NET.
Advanced ASPX GridView Pagination and Data Entities[^]
文本框txtbox1 =(文本框)Page.FindControl(textbox1);
txtbox1.Text =your string;
Textbox txtbox1=(Textbox)Page.FindControl("textbox1");
txtbox1.Text = "your string";
hiiii .......
用它来获取gridview文本框值
< br $> b $ b
hiiii.......
use this to get the gridview textbox value
if (dataGrid1.SelectedItems.Count > 0)
{
for (int i = 0; i < dataGrid1.SelectedItems.Count; i++)
{
System.Data.DataRowView selectedFile = (System.Data.DataRowView)dataGrid1.SelectedItems[i];
strdata = Convert.ToString(selectedFile.Row.ItemArray[1]);
strdata1 = Convert.ToString(selectedFile.Row.ItemArray[2]);
}
}
这篇关于如何在类文件中调用textbox id,gridview id ....的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文