Reach UserControl from ASPX codebehind?

Discussion in 'ASP .Net Web Controls' started by Özden Irmak, Jun 16, 2005.

  1. Özden Irmak

    Özden Irmak Guest

    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
    Özden Irmak, Jun 16, 2005
    #1
    1. Advertising

  2. Özden Irmak

    Brock Allen Guest

    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
    >
    Brock Allen, Jun 16, 2005
    #2
    1. Advertising

  3. Özden Irmak

    Özden Irmak Guest

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

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

    this works...

    "Brock Allen" <> wrote in message
    news:...
    > 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
    >>

    >
    >
    >
    Özden Irmak, Jun 16, 2005
    #3
  4. 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" <> wrote in message
    > news:...
    > > 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
    > >>

    > >
    > >
    > >

    >
    >
    >
    Michael Baltic, Jun 30, 2005
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Micke Palm

    Reach another function in a usercontrol

    Micke Palm, May 4, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    398
    Micke Palm
    May 4, 2004
  2. Support
    Replies:
    2
    Views:
    612
    Support
    Mar 24, 2005
  3. Edwin Knoppert

    Public struct in usercontrol, can't reach items

    Edwin Knoppert, Dec 5, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    320
    Edwin Knoppert
    Dec 5, 2006
  4. Özden Irmak

    Reach UserControl from ASPX codebehind?

    Özden Irmak, Jun 16, 2005, in forum: ASP .Net Building Controls
    Replies:
    3
    Views:
    149
    Michael Baltic
    Jun 30, 2005
  5. Support

    stuck: I cant reach usercontrol's class ..

    Support, Mar 24, 2005, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    119
    Louis Yeung
    Apr 1, 2005
Loading...

Share This Page