S
Sundararajan
Hi folks,
I have some 10 LinkButton controls by the name
lnkbtnPage1,lnkbtnPage2...lnkbtnPage10.
I manipulate the visibility of these controls by
for(intLoop=1; intLoop<GROUPPAGESIZE;intLoop++)
{
((LinkButton)(FindControl("lnkbtnPage"+intLoop))).Visible=false;
}
This works fine in user controls.
But i want to do the same operation in Custom controls there this
FindControl does not work and it throws the error object reference not set to
an instance of the object.
I am doing this after adding the link buttons to the Controls collection in
CreateChildControls method.
Is there any work around.
I have some 10 LinkButton controls by the name
lnkbtnPage1,lnkbtnPage2...lnkbtnPage10.
I manipulate the visibility of these controls by
for(intLoop=1; intLoop<GROUPPAGESIZE;intLoop++)
{
((LinkButton)(FindControl("lnkbtnPage"+intLoop))).Visible=false;
}
This works fine in user controls.
But i want to do the same operation in Custom controls there this
FindControl does not work and it throws the error object reference not set to
an instance of the object.
I am doing this after adding the link buttons to the Controls collection in
CreateChildControls method.
Is there any work around.