FIndcontrol doesn't seem to work inside a baseclass....

Posted by Pandiya Chendur on Stack Overflow See other posts from Stack Overflow or by Pandiya Chendur
Published on 2010-03-24T09:12:16Z Indexed on 2010/03/24 11:03 UTC
Read the original article Hit count: 375

Filed under:
|
|

I use LinkButton linkBtn = (LinkButton)FindControl(ControlID); inside a method in my baseclass...

This works within a normal aspx page when given,

LinkButton linkBtn = (LinkButton)FindControl("lnkBtn1");

But when it is a contentpage included within a masterpage it doesn't work...

LinkButton linkBtn = (LinkButton)FindControl("ctl00_ContentPlaceHolder1_lnkbtn");

i get the error Object reference not set to an instance of an object.

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about findcontrol