When does the main class get instantiated?

S

Sean W.

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top