UserControl's Page_Load firing automatically

Discussion in 'ASP .Net Web Controls' started by Glenn Spies, Nov 2, 2005.

  1. Glenn Spies

    Glenn Spies Guest

    Hi

    I created a default webform and a default webusercontrol with vs2003.
    I then added the usercontrol to the form and browsed the page.
    As expected, the Page_Load event fired due to the automatically created code
    in InitializeComponent in the ascx.cs

    I then modified the webform to refer to the usercontrol using NameSpace= and
    Assembly= @ Register directives while removing src=

    The interesting thing is the page_load in the usercontrol now fires *twice*.
    To get it to fire once only I had to remove the event wiring in the
    usercontrol.

    Can somebody please explain to me what is happening? I don't want to remove
    what appears to be correct event wiring =)

    Regards,
    Glenn
     
    Glenn Spies, Nov 2, 2005
    #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. Sosh
    Replies:
    2
    Views:
    4,936
  2. Event not firing in usercontrol inside usercontrol

    , Dec 10, 2004, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    197
  3. Event not firing in usercontrol inside usercontrol

    , Dec 10, 2004, in forum: ASP .Net Building Controls
    Replies:
    1
    Views:
    198
    vatech1993
    Dec 11, 2004
  4. Event not firing in usercontrol inside usercontrol

    , Dec 10, 2004, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    166
  5. Glenn Spies

    UserControl's Page_Load firing automatically

    Glenn Spies, Nov 3, 2005, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    118
    Glenn Spies
    Nov 3, 2005
Loading...

Share This Page