https://docs.microsoft.com/en-us/dotnet/api/system.web.ui.control.findcontrol?view=netframework-4.7

FindControl(String)

Searches the current naming container for a server control with the specified id parameter.

public virtual System.Web.UI.Control FindControl (string id);
Parameters
id
String

The identifier for the control to be found.

Returns

The specified control, or null if the specified control does not exist.

Remarks

Use FindControl to access a control from a function in a code-behind page, to access a control that is inside another container, or in other circumstances where the target control is not directly accessible to the caller.

This method will find a control only if the control is directly contained by the specified container; that is, the method does not search throughout a hierarchy of controls within controls.

For information about how to find a control when you do not know its immediate最接近的 container, see How to: Access Server Controls by ID.

Docs-->.NET-->API reference-->System.​Web.​UI-->Control-->Methods-->Find​Control的更多相关文章

  1. System.Web.UI.WebControls.FileUpload.cs

    ylbtech-System.Web.UI.WebControls.FileUpload.cs 1. 程序集 System.Web, Version=4.0.0.0, Culture=neutral, ...

  2. 'DataVisualization' does not exist in the namespace 'System.Web.UI'一例解决办法

    之前项目是vs2010 aspx项目,用vs2017打开后,非运行状态下有一行错误:CS0234 C# The type or namespace name 'DataVisualization' d ...

  3. System.Web.UI.Page的页面基类

    服务器端的page类 所有我们编写的页面都继承自page类,可见page类是非常重要的,page类提供了哪些功能,直接决定了我们的页面类可以继承什么功能,或者说,直接决定了我们的页面类功能的强大与否! ...

  4. 继承System.Web.UI.Page的页面基类

    服务器端的page类      所有我们编写的页面都继承自page类,可见page类是非常重要的,page类提供了哪些功能,直接决定了我们的页面类可以继承什么功能,或者说,直接决定了我们的页面类功能的 ...

  5. foreach statement cannot operate on variables of type 'System.Web.UI.WebControls.Table' because 'System.Web.UI.WebControls.Table' does not contain a public definition for 'GetEnumerator'

    错误:foreach statement cannot operate on variables of type 'System.Web.UI.WebControls.Table' because ' ...

  6. 非静态的字段、方法或属性“System.Web.UI.Page.ClientScript...”要求对象引用 (封装注册脚本)

    在写项目时想对asp.net的注册前台脚本事件进行封装,就添加了一个BasePage.cs页面,但一直报错‘非静态的字段.方法或属性“System.Web.UI.Page.ClientScript.. ...

  7. “System.Web.UI.WebControls.Literal”不允许使用子控件

    今天在写下面的代码时遭遇错误——“System.Web.UI.WebControls.Literal”不允许使用子控件('System.Web.UI.WebControls.Literal' does ...

  8. System.Web.UI.ScriptManager.RegisterStartupScript(语句末尾加分号,不然可能会造成语句不执行)

    System.Web.UI.ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "testKey", &q ...

  9. 解决类型“System.Web.UI.UpdatePanel”不具有名为“Gridview”的公共属性,

    类型“system.web.ui.updatepanel” 不具有名为“XXX”的公共属性,其实原因很简单.就是少了一个<ContentTemplate></ContentTempl ...

  10. 无法将类型“ASP.login_aspx”转换为“System.Web.UI.WebControls.Login”

    今天碰上了一个很傻的问题,起码我认为是这样. 项目中首页名是:Login.aspx,编译.运行都没有出现问题. 于是打包发布网站,各项内容都配置好后,问题出现了.一运行首页面就出现下面这个错误: 编译 ...

随机推荐

  1. js 实现 水仙花数

    水仙花数是指一个 n 位数 ( n≥3 ),它的每个位上的数字的 n 次幂之和等于它本身.(例如:1^3 + 5^3+ 3^3 = 153) <!DOCTYPE html><html ...

  2. MFC 创建新项目

    本文主要介绍如何是使用vc++创建MFC项目,并简单介绍整个项目的基本框架.文件–>新建,会弹出以下新建文件(项目)类型的界面,如下 按上图的步骤u,创建一个MFC工程.其中步骤3中的CardD ...

  3. P3066 [USACO12DEC]逃跑的BarnRunning Away From… 树上差分_树上倍增

    code: #include <cstdio> using namespace std; #define ll long long const int N=200005; int n,fa ...

  4. javascript上下文this

    js的四种调用方式: 一 作为函数的调用: 在严格模式下this,undefined,在非严格模式下指向全局window对象. 二 作为方法调用: this通常指向调用的对象 三 作为构造函数的调用: ...

  5. div的padding和margin

    原div一和div二的位置 增大div二的margin-left 增大div二的padding-top

  6. iOS开发——设置屏幕亮度

    想在APP里面调节屏幕的亮度,这只是个小众需求.而且,虽然可以直接调节手机的亮度,但是它还是个需求,客户有需求,剩下的就是我们的事了,好了,吐槽到此结束. 刚拿到这个需求的人,或许想的是直接对view ...

  7. UVA-10200 Prime Time 素数(注意除法精度)

    题目链接:https://cn.vjudge.net/problem/UVA-10200 题意 给出一个公式$ m=n^2+n+41, n \in Z^+ $ 现在$ a,b\in[0, 10000] ...

  8. shell脚本不同运行方式的差异

    说明:以下是个人的见解,不一定都正确,如有错误,欢迎指正! 一,shell脚本的运行方式,最常见的有以下几种: 1 )  . xxx.sh,注意,前面是一个点'.' 2 ) source xxx.sh ...

  9. python 基础使用list、dict、set、可变与不可变对象

    参考链接:https://www.liaoxuefeng.com/wiki/1016959663602400/1017104324028448 dict是字典,可以储存键值对类型的值,set与dict ...

  10. CSU 1378 Shipura 简单模拟

    上周末中南的题,当时就知道是个简单模拟题,可是一个多小时就是没写出来,代码能力啊 >.< 题意: 某人发明了一种程序语言,只支持一种运算">>",和一种函数 ...