Find a Nested Web Control within a Web Control with C#

I was having issues accessing a web control directly within a user control and used the following to access the web control within a LoginView in the User Control.

The same syntax below can be used if you are looking for a nested control within a control.

System.Web.UI.WebControls.Literal name_literal = (System.Web.UI.WebControls.Literal)this.LoginView1.FindControl("name");
name_literal.Text = "Text goes here";


Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter

Related Posts

Tags: , , ,

Leave a Reply





Donate

If you found this article useful and would like to see more like it this please consider making a donation.

Sponsors