Coleen,
I'm having trouble understanding exactly what you want to do, but from
what I gather, you need to know when a new user comes in and handle
them differently than an existing user. Let's break down your request,
with some additional questions inline.
>...when they login,
if they are a new user, a new account screen comes up
I assume here that you're checking a database when the user attempts to
login and if the user isn't found you want to redirect to the "new user
signup" -or- the user clicks a "register" button to get to the signup
page. Correct?
>from there a
series of screens need to be entered in a specific order.
You have a "wizard type" progression that you want to perform here?
Then, depending
on what they select after they have completed the new account info, the flow
needs to direct them from the entry screens to invoices, payments,
electronic signature and receipts pages.
You want the choices they've made to dictate where they are sent
afterwards, and these options are saved in the database with each user
account?
>I currently am using
Session State (variables) and pass them from the directory page to the page
called. The problem with this is that we also have a JavaScript Drop-down
menu and the variables don't get set if they select a page from the drop
down. How do I overcome this limitation? Isn't there a better way to do
this?
This kinda sounds like you're not storing the user's options in the
database, please correct me if I'm wrong.
-------------------------------------------------------------
Here's how I'd attack this if it were my problem. There are many ways
to do it, but this is my OPINION (as I don my flame retardant gear).
When a new user attempts to login or clicks to register, I'd redirect
them to my new user signup. I'd use server-side HTML tables to house
each "page" of the signup process (all on one aspx page), and control
the user's progress with a hidden textbox's value. I'd use next and
back buttons to increment the hidden textbox's value. I'd use a Select
Case on that value in the code-behind to determine which table needed
to be visible (only 1 table "Page" visible at a time).
For instance:
(HTML)
<Table id=tblSignUp1 runat=server>
[Sign up Procedure - Page 1 (Your HTML for Page 1)]
</Table>
<Table id=tblSignUp2 runat=server visible=False>
[Sign up Procedure - Page 2 (Your HTML for Page 2)]
</Table>
<Table id=tblSignUp3 runat=server visible=False>
[Sign up Procedure - Page 3 (Your HTML for Page 3)]
</Table>
<asp:button id=btnNext text="Next" runat=server></asp:button>
<asp:button id=btnBack text="Back" runat=server></asp:button>
<input type=hidden name="txtStep">
(code-behind in PageLoad of Signup.aspx)
Dim myStepNum as Int16
myStepNum = Cint(Request.Pa rameters("txtSt ep"))
Select Case myStepNum
Case 1 'Display page 1
tblSignUp1.Visi ble = True
tblSignUp2.Visi ble = False
tblSignUp3.Visi ble = False
Case 2 'Display page 2
tblSignUp1.Visi ble = False
tblSignUp2.Visi ble = True
tblSignUp3.Visi ble = False
Case 3 'Display page 3
tblSignUp1.Visi ble = False
tblSignUp2.Visi ble = False
tblSignUp3.Visi ble = True
End Select
When the user clicks "DONE", I'd insert a new record into the DB and
(in a separate table) add all the user's options. I'd then redirect
the user back to the login page. The login procedure should add the
user's ID to Context.Session .Item("user_id" ) - [from the DB during
login if the user is validated]
Then, I would create a class called usersettings. On each page load,
I'd instantiate the usersettings class and load all the user's info
into my class variable through a query to the database based upon my
Context.Session .Item("user_id" ) value. I'd create a method to handle
this population.
Something like this:
[Class]
Public Class usersettings
Public Structure oUser
Public UID as int16
Public setting1 as string
Public setting2 as string
End Structure
Public Function GetSettings(ByV al user_id as Int16) as oUser
Dim currentUser as oUser
[connect to database and retrieve settings]
currentUser.UID = user_id
currentUser.set ting1 = myDataView(0).R ow("Setting1")
...
Return currentUser
End Function
End Class
[Page Load]
Dim tmp as New usersettings
Dim myUser as oUser
myUser = tmp.GetUserInfo (Context.Sessio n.Item("user_id "))
tmp = Nothing
This way, I have all the user info at my disposal before anything else
on the page happens. You could probably do this in Global.asax in the
BeginRequest event too. I'll leave that for later.
Not sure how the java menu's will affect this approach because I don't
use them.
Maybe this is a start for you, maybe I'm completely off base as far as
the questions you asked, and maybe someone will tell me that this is a
horrible approach, but I've used this successfully in the past. The
code included wasn't compiled and is really just a Psuedo-code example.
Let me know if it helps. Good luck
dkb