Avatar of spgaddipati
spgaddipati
 asked on

Accessing UserControl in class file

Is there a way to access a usercontrol in a class file
I have file defaultpage.aspx
defaultpage.aspx.vb class inherits dpclass.vb
dpclass.vb inherits system.web.ui.page

Now I have a usercontrol filterbar.ascx which is added to page default.aspx
How can i access the control in dpcalss.vb
Any  help woub be appriciated.

Visual Basic.NETASP.NET

Avatar of undefined
Last Comment
Bob Learned

8/22/2022 - Mon
Bob Learned

You should be able to use Page.FindControl(id) with the ID for the FilterBar user control.

Bob
spgaddipati

ASKER
it is returning nothing
ASKER CERTIFIED SOLUTION
Bob Learned

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck