Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Building Controls > Reach UserControl from ASPX codebehind?

Reply
Thread Tools

Reach UserControl from ASPX codebehind?

 
 
Özden Irmak
Guest
Posts: n/a
 
      06-16-2005
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


 
Reply With Quote
 
 
 
 
Brock Allen
Guest
Posts: n/a
 
      06-16-2005
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
>




 
Reply With Quote
 
 
 
 
Özden Irmak
Guest
Posts: n/a
 
      06-16-2005
Thanks for the reply, and I found my solution...

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

this works...

"Brock Allen" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ...
> 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
>>

>
>
>



 
Reply With Quote
 
Michael Baltic
Guest
Posts: n/a
 
      06-30-2005
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


"Ă–zden Irmak" wrote:

> Thanks for the reply, and I found my solution...
>
> JCThumbView JCThumbView1 = (JCThumbView)Page.FindControl("JCThumbView1");
>
> this works...
>
> "Brock Allen" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed) ...
> > 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
> >>

> >
> >
> >

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Public struct in usercontrol, can't reach items Edwin Knoppert ASP .Net 1 12-05-2006 09:49 AM
Reach UserControl from ASPX codebehind? Özden Irmak ASP .Net Web Controls 3 06-30-2005 02:46 PM
stuck: I cant reach usercontrol's class .. Support ASP .Net Web Controls 1 04-01-2005 06:47 PM
stuck: I cant reach usercontrol's class .. Support ASP .Net 2 03-24-2005 04:35 PM
Reach another function in a usercontrol Micke Palm ASP .Net 2 05-04-2004 07:48 PM



Advertisments