load ascx and set properties

Discussion in 'ASP .Net' started by google@ratemyband.co.uk, Jul 20, 2007.

  1. Guest

    Hi,
    [using asp.net 2.0 framework]
    I'm using loadControl to load an ascx into a variable.
    This works ok but I'm having to load the control into an Object
    variable
    e.g.
    Dim aWidget As Object = Me.LoadControl("/assets/components/
    Widget.ascx")

    I'd like to be able to load it into a variable of the proper type so I
    can set properties.

    I'm pretty sure I could do this with the 1.1 framework simply by
    changing the ascx class to public, but this doesn't work with 2.0

    Many thanks,
     
    , Jul 20, 2007
    #1
    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. Quentin
    Replies:
    1
    Views:
    508
    Quentin
    Jul 29, 2003
  2. Jason Shohet
    Replies:
    1
    Views:
    499
    Kevin Spencer
    Nov 10, 2003
  3. Bogosian
    Replies:
    5
    Views:
    4,801
    Jim Cheshire [MSFT]
    Jan 7, 2004
  4. Replies:
    5
    Views:
    437
    Peter Bucher [MVP]
    Jul 20, 2007
  5. Douglas J. Badin

    .ascx UserControl Properties are set after Page_Load only on PostBacks

    Douglas J. Badin, Oct 13, 2003, in forum: ASP .Net Building Controls
    Replies:
    3
    Views:
    428
    Douglas J. Badin
    Oct 14, 2003
Loading...

Share This Page