Find control recursively via extension method


/ Published in: C#
Save to your folder(s)

And usage:

protected void Page_Load(object sender, EventArgs e)

{

Label theLabel = form1.FindControlR("ControlToFind") as Label;

if (theLabel != null)

{

theLabel.Text = "Found it!";

}

}

URL: http://aspadvice.com/blogs/name/archive/2008/03/31/Creating-a-Recursive-FindControl-Extension-Method.aspx

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.