When does the main class get instantiated?

Discussion in 'ASP .Net Web Controls' started by Sean W., May 11, 2006.

  1. Sean W.

    Sean W. Guest

    I need help understanding how and when a class becomes instantiated.

    Scenario...
    I have an ascx in which I put in some AJAX code. I put the ascx on a page.
    The control is used for users to login to the site. The page puts the control
    on if the user has not been authenticated yet. So, now the user visits the
    site and has not logged in yet. The control is drawn and made available for
    them to login. They type in their credentials and hit the login button. The
    button validates their login with a custom routine.

    The problem...
    The problem is that the AJAX fails. It says the class has not be
    instantiated yet. "Object not set to a reference of the object", or something
    like that. The AJAX code calls the login routine when the user leaves the
    password field in the login control. The login routine is in the class that
    contains the Page_Load, etc, of the control. I set a breakpoint on the first
    line of the login routine and the execution does stop there, so I know its
    trying to execute the function.

    How can it not be instantiated if it's already on the screen?

    A quick side note...
    The page adds the control to itself using,
    ContentPane.Controls.Add(Page.LoadControl("~/SignIn.ascx"))


    TIA

    Sean
    Sean W., May 11, 2006
    #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. Ed Dana
    Replies:
    24
    Views:
    1,036
    Bryce
    Feb 3, 2005
  2. John Smith
    Replies:
    0
    Views:
    494
    John Smith
    Aug 17, 2004
  3. J
    Replies:
    1
    Views:
    282
  4. Fredp
    Replies:
    5
    Views:
    379
    Fredp
    May 3, 2006
  5. Random
    Replies:
    2
    Views:
    347
    Random
    Dec 28, 2006
Loading...

Share This Page