拖了一个GridView到页面,当没有数据时在EmptyDataTemplate中显示添加的TextBox,但EmptyDataTemplate中不像FooterTemplate可以直接TextBox BankCard= GridView1.FooterRow.FindControl("BankCa...
分类:
Web程序 时间:
2014-09-18 20:26:24
阅读次数:
257
获取母版页的相关内容有两种方法1 通过findcontrol找控件ID需要在此事件中~因为Page_load中时是先内容页加载然后才是母版页加载 protected void Page_LoadComplete(object sender, EventArgs e) { L...
分类:
Web程序 时间:
2014-09-18 16:07:24
阅读次数:
172
如何在Repeater的HeaderTemplate和FooterTemplate模板中寻找控件?在Repeater的ItemTemplate模板中的控件,我们可以用Items属性来遍历行并用FindControl进行寻找。如下所示:在Repeater的Item Command事件下下遍历:for(...
分类:
Web程序 时间:
2014-09-03 11:06:36
阅读次数:
225
做了一个通过字符串ID查找页面控件并且给页面控件赋值的功能,过程中遇到了this.FindControl("id")返回值都是Null的问题,记录一下解决办法。问题的原因是我所要查找的ID控件的父控件不是this所造成的。所以我写了一个递归方法获取控件: 1 /// 2 /// 获取页面中某个控件....
分类:
其他好文 时间:
2014-08-29 14:27:08
阅读次数:
204
1 public static void ControlFind(GridControl grid) 2 { 3 FindControl fControl = null; 4 foreach (Control item in gr...
分类:
其他好文 时间:
2014-08-21 16:51:44
阅读次数:
168
关键代码: /// /// 按名称查找控件 /// /// 查找控件的父容器控件 /// 查找控件名称 /// 若没有查找到返回NULL public static Control FindControl(this Control parentControl, string fin...
Button btn=(Button)this.Master.FindControl("Button1");btn.Visible=false;模板页中要注意html控件的url问题ResolveClientUrl:获得相对路径ResolveUrl:相对于跟目录的路径
分类:
其他好文 时间:
2014-08-02 23:08:44
阅读次数:
217
Sub getFont()
Set FontList = Application.CommandBars("Formatting").FindControl(Id:=1728)
If FontList Is Nothing Then
Set TempBar = Application.CommandBars.Add
Set FontList...
分类:
其他好文 时间:
2014-07-29 18:12:02
阅读次数:
295
private void DisplayHotBooks() { //获取所有的书分类信息 IList list = CategoryManager.GetAllCategories(); int i = 0; foreach (Category item in list) { AccordionP...
分类:
其他好文 时间:
2014-07-28 14:39:53
阅读次数:
354
private RichTextBox FindControl() { RichTextBox ret = null; try { Control[] controls = Application.OpenForms["MainForm"].Controls.Find("txtContent", ....