Home All Groups Group Topic Archive Search About

Reach UserControl from ASPX codebehind?

Author
16 Jun 2005 2:26 PM
Ö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

Author
16 Jun 2005 2:59 PM
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.

-Brock
DevelopMentor
http://staff.develop.com/ballen



Show quoteHide quote
> 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
>
Author
16 Jun 2005 3:13 PM
Özden Irmak
Thanks for the reply, and I found my solution...

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

this works...

Show quoteHide quote
"Brock Allen" <ballen@NOSPAMdevelop.com> wrote in message
news:913866632545163371154960@msnews.microsoft.com...
> 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.
> -Brock
> DevelopMentor
> http://staff.develop.com/ballen
>
>
>
>> 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
>>
>
>
>
Author
30 Jun 2005 2:46 PM
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.
--
Staff Consultant II - Enterprise Web Services - Cardinal Solutions Group

Future Business Model - National City Mortgage


Show quoteHide quote
"Özden Irmak" wrote:

> Thanks for the reply, and I found my solution...
>
> JCThumbView JCThumbView1 = (JCThumbView)Page.FindControl("JCThumbView1");
>
> this works...
>
> "Brock Allen" <ballen@NOSPAMdevelop.com> wrote in message
> news:913866632545163371154960@msnews.microsoft.com...
> > 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.
> > -Brock
> > DevelopMentor
> > http://staff.develop.com/ballen
> >
> >
> >
> >> 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
> >>
> >
> >
> >
>
>
>