Ask a Question related to ASP.NET Building Controls, Design and Development.
-
keith #1
User Control Populate Form after Log On - newbie question
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
keith Guest
-
Page_Load called more than once for user control - newbie question
Hi, I have a page with a user control as header, which in turn has a user control drop down list. When I run the page in debug with a break on... -
Newbie Question: User selected query
I have a datagrid that is populated by a SQL query that is create by the user. Their is a DropDOwnList and a textbox. This gives them the WHERE... -
Newbie Web Service Question regarding User Controls
Can I return a user control from a Web Service? I have a Web Page that has a Placeholder on it and I wish to populate this placeholder with a... -
Beginner Question - How to populate HTML form from PHP/MySQL
I have found many examples of how to access an HTML text field from PHP, but cannot find the reverse - how to load an HTML form from a MySQL... -
User control newbie question - pls help
I have a user control with a label and a method. The webform should call the method on the user control and populate the label. I am getting object... -
keith #2
RE: User Control Populate Form after Log On - newbie question
To answer my own question:
In the user control I created an event
Public Event eLoggedIn()
and raised it when I had a confirmed log on:
RaiseEvent eLoggedIn()
which I could then handle on the Page.
Keith
keith Guest



Reply With Quote

