K
keith
Hi,
I have a user control that contains a login element, textboxes for username
and password, and a button to submit, which appears in the header of each
page in my asp.net application. All of the below is done with code behind.
When the user correctly logs on, it sets a public property bLoggedOn to true
and makes the text boxes enabled = false.
This works fine across all the pages in the application.
However, some pages have a form where the user can change their data. I
populate these in the onload event for the page, if the user control's
bLoggedOn is true. ( I use a session variable to maintain this across the
pages)
However, if I log on while on one of these pages, the form does not populate.
I have a reset button that clears the form if not logged on, or repopulates
it with the original data if logged on, which works fine. Pressing the page
link in the header (calling itself) works.
Logging on via the user control calls the page_onload, but it happens before
the user control checks the log on information and sets it's bLoggedOn
property to true. (I set break points to confirm this)
Is there an event on the page that I can use to populate the form after
loggin in via the user control?
here's what doesn't work:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
If Header1.pLoggedIn Then
loadForm()
End If
End Sub
As I said, Load Form works if we enter the page logged on, or press the
refresh button on that page.
Thanks,
Keith
I have a user control that contains a login element, textboxes for username
and password, and a button to submit, which appears in the header of each
page in my asp.net application. All of the below is done with code behind.
When the user correctly logs on, it sets a public property bLoggedOn to true
and makes the text boxes enabled = false.
This works fine across all the pages in the application.
However, some pages have a form where the user can change their data. I
populate these in the onload event for the page, if the user control's
bLoggedOn is true. ( I use a session variable to maintain this across the
pages)
However, if I log on while on one of these pages, the form does not populate.
I have a reset button that clears the form if not logged on, or repopulates
it with the original data if logged on, which works fine. Pressing the page
link in the header (calling itself) works.
Logging on via the user control calls the page_onload, but it happens before
the user control checks the log on information and sets it's bLoggedOn
property to true. (I set break points to confirm this)
Is there an event on the page that I can use to populate the form after
loggin in via the user control?
here's what doesn't work:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
If Header1.pLoggedIn Then
loadForm()
End If
End Sub
As I said, Load Form works if we enter the page logged on, or press the
refresh button on that page.
Thanks,
Keith