Reach UserControl from ASPX codebehind?

Ö

Özden Irmak

Hi,

I created a usercontrol and dropped it onto my aspx...

But from CodeBehind of that aspx I can't reach to that UserControl...I just
want to reach to it just like when I dropped for instance a textbox onto
that form so I can play with it's properties and subscribe to it's events?

Anybody can help?

I'm using Framework 1.1

Regards,

Özden Irmak
 
B

Brock Allen

If the user control has a codebehind, than that's the class you can declare
and use from your ASPX's codebehind. If the ASCX doesn't, then the only place
you'll be able to make early bound function calls on it is from any inline
code in your ASPX.
 
Ö

Özden Irmak

Thanks for the reply, and I found my solution...

JCThumbView JCThumbView1 = (JCThumbView)Page.FindControl("JCThumbView1");

this works...
 
M

Michael Baltic

If you declare your user control manually in the same fashion that the
webform generated code does for the aspx controls, then you will be able to
access your controls anywhere on the page.

You can even capture events raised by your control the same way you would an
aspx control.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top