By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,137 Members | 2,209 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,137 IT Pros & Developers. It's quick & easy.

Please! Doesn't anyone know a better way to do this?

P: n/a
Hi All :-)

I am desperately looking for some help/information on how to direct page
flow. Forget what I have done - here's what I need to do:

I have a large ASPX.Net - VB.Net web application (around 35-40 pages) that
once the user logs in, I need to direct them to the correct page, depending
on what they select from the directory. In other words...when they login,
if they are a new user, a new account screen comes up and from there a
series of screens need to be entered in a specific order. 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.

I know this can be done, we do it all the time when doing things such as
ordering books, or any type of on-line shopping. 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?

Please Help! Any info would be GREATLY appreciated!

TIA,

Coleen
Sep 5 '06 #1
Share this Question
Share on Google+
9 Replies


P: n/a
Have you looked at the Wizard server control? HTH.
David
"Coleen" <co**********@yahoo.comwrote in message
news:OQ**************@TK2MSFTNGP05.phx.gbl...
Hi All :-)

I am desperately looking for some help/information on how to direct page
flow. Forget what I have done - here's what I need to do:

I have a large ASPX.Net - VB.Net web application (around 35-40 pages) that
once the user logs in, I need to direct them to the correct page,
depending
on what they select from the directory. In other words...when they login,
if they are a new user, a new account screen comes up and from there a
series of screens need to be entered in a specific order. 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.

I know this can be done, we do it all the time when doing things such as
ordering books, or any type of on-line shopping. 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?

Please Help! Any info would be GREATLY appreciated!

TIA,

Coleen


Sep 5 '06 #2

P: n/a
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.Parameters("txtStep"))

Select Case myStepNum
Case 1 'Display page 1
tblSignUp1.Visible = True
tblSignUp2.Visible = False
tblSignUp3.Visible = False
Case 2 'Display page 2
tblSignUp1.Visible = False
tblSignUp2.Visible = True
tblSignUp3.Visible = False
Case 3 'Display page 3
tblSignUp1.Visible = False
tblSignUp2.Visible = False
tblSignUp3.Visible = 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(ByVal user_id as Int16) as oUser
Dim currentUser as oUser
[connect to database and retrieve settings]
currentUser.UID = user_id
currentUser.setting1 = myDataView(0).Row("Setting1")
...
Return currentUser
End Function
End Class

[Page Load]
Dim tmp as New usersettings
Dim myUser as oUser
myUser = tmp.GetUserInfo(Context.Session.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

Sep 5 '06 #3

P: n/a
Well you've got it partially right. We will be storing the user's name &
password (right now the application is set up as a "Demo") What I'm trying
to do is direct the user from page to page - i.e., after the user sets up an
account, they need to automatically be directed to the page to enter data
for the fleet (this is a Fleet vehicle registration application) and after
they enter the fleet info they need to be directed to the vehicle
registration section. This is actually quite easy the way that I'm doing it
with Session Variables (in the directory if they chose Add Account I set a
session variable on the Account page (Session("page_name"). This session
variable gets changed as they flow from window to window using the Next
button. If they use the JavaScript drop-down menu instead, the session
variable doesn't get set and the next page doesn't "know" where it was
called from...does that make more sense? I'm using .Net 1.1 right now but
we are (supposed) to be upgrading to .Net 2005 (ASPX 2.0). I just can't
think of a better way to "tell" my pages which page the call originated
from...is there another way that the JavaScript menus won't interfere with?
Thanks very much for any/all help :-)
"Dblood" <db*********@infinitechs.comwrote in message
news:11**********************@b28g2000cwb.googlegr oups.com...
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.Parameters("txtStep"))

Select Case myStepNum
Case 1 'Display page 1
tblSignUp1.Visible = True
tblSignUp2.Visible = False
tblSignUp3.Visible = False
Case 2 'Display page 2
tblSignUp1.Visible = False
tblSignUp2.Visible = True
tblSignUp3.Visible = False
Case 3 'Display page 3
tblSignUp1.Visible = False
tblSignUp2.Visible = False
tblSignUp3.Visible = 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(ByVal user_id as Int16) as oUser
Dim currentUser as oUser
[connect to database and retrieve settings]
currentUser.UID = user_id
currentUser.setting1 = myDataView(0).Row("Setting1")
...
Return currentUser
End Function
End Class

[Page Load]
Dim tmp as New usersettings
Dim myUser as oUser
myUser = tmp.GetUserInfo(Context.Session.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

Sep 5 '06 #4

P: n/a
Colleen,

Here something to try, create a String variable (I'll call it
strRefUrl) then in Page Load, assign it: strRefUrl =
Request.UrlReferrer, the result SHOULD be the url of the page you just
left. You'll have to parse the page name out by doing some string
manipulation, but it should be easy enough with the InStrRev() function
looking for the first "/" character (because we're going right to left)
and then using the Mid() function to pull out the page name. Assign
that to your Session variable and then proceed as normal. Again, I
don't know if the Java buttons are going to affect this, but it's worth
a try.

If the string stuff holds you up, post the page url and I'll write the
code to parse the string.

dkb

Sep 5 '06 #5

P: n/a
DKB - Thank you so much for the suggestion. Let me try the string stuff
myself - I'm going to play with it for a few days - I'm stuck waiting for
the upgrade to .Net 2005 before I can do a whole lot on this right now, but
at least this gets me started! Thanks, I really appreciate the help!
Sometimes you just need another view on how to do things...

Coleen
"Dblood" <db*********@infinitechs.comwrote in message
news:11*********************@h48g2000cwc.googlegro ups.com...
Colleen,

Here something to try, create a String variable (I'll call it
strRefUrl) then in Page Load, assign it: strRefUrl =
Request.UrlReferrer, the result SHOULD be the url of the page you just
left. You'll have to parse the page name out by doing some string
manipulation, but it should be easy enough with the InStrRev() function
looking for the first "/" character (because we're going right to left)
and then using the Mid() function to pull out the page name. Assign
that to your Session variable and then proceed as normal. Again, I
don't know if the Java buttons are going to affect this, but it's worth
a try.

If the string stuff holds you up, post the page url and I'll write the
code to parse the string.

dkb

Sep 5 '06 #6

P: n/a
Coleen,

Oops. It should be Request.URL.Referrer.ToString.

You;d have figured that out, I'm sure, but I feel better now that I
didn't give you bum info.

dkb

Sep 5 '06 #7

P: n/a
You're wasting your time using 1.1 because everything you need to do is
built into 2.0; the Wizard control and Membership, Roles and Profiles all of
which make it possible for the business rules your working with rather easy
to build.

<%= Clinton Gallagher
NET csgallagher AT metromilwaukee.com
URL http://clintongallagher.metromilwaukee.com/
MAP 432'17"N 882'37"W : 432'17"N 882'37"W

"Coleen" <co**********@yahoo.comwrote in message
news:OQ**************@TK2MSFTNGP05.phx.gbl...
Hi All :-)

I am desperately looking for some help/information on how to direct page
flow. Forget what I have done - here's what I need to do:

I have a large ASPX.Net - VB.Net web application (around 35-40 pages) that
once the user logs in, I need to direct them to the correct page,
depending
on what they select from the directory. In other words...when they login,
if they are a new user, a new account screen comes up and from there a
series of screens need to be entered in a specific order. 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.

I know this can be done, we do it all the time when doing things such as
ordering books, or any type of on-line shopping. 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?

Please Help! Any info would be GREATLY appreciated!

TIA,

Coleen


Sep 6 '06 #8

P: n/a
Thank you! I get my new "Test" machine today, so I should now be able to
test this in ASP.Net 2 :-D

"Dblood" <db*********@infinitechs.comwrote in message
news:11*********************@e3g2000cwe.googlegrou ps.com...
Coleen,

Oops. It should be Request.URL.Referrer.ToString.

You;d have figured that out, I'm sure, but I feel better now that I
didn't give you bum info.

dkb

Sep 6 '06 #9

P: n/a
I know! I've been nagging at our Management for months to complete the
upgrade - I finally got news this morning that I will get the "Test" machine
today and I can start testing the move of our application and can really
start to accomplish something now! Yay!!!

Thanks :-)

Coleen

"clintonG" <cs*********@REMOVETHISTEXTmetromilwaukee.comwro te in message
news:%2***************@TK2MSFTNGP05.phx.gbl...
You're wasting your time using 1.1 because everything you need to do is
built into 2.0; the Wizard control and Membership, Roles and Profiles all
of
which make it possible for the business rules your working with rather
easy
to build.

<%= Clinton Gallagher
NET csgallagher AT metromilwaukee.com
URL http://clintongallagher.metromilwaukee.com/
MAP 432'17"N 882'37"W : 432'17"N 882'37"W

"Coleen" <co**********@yahoo.comwrote in message
news:OQ**************@TK2MSFTNGP05.phx.gbl...
Hi All :-)

I am desperately looking for some help/information on how to direct page
flow. Forget what I have done - here's what I need to do:

I have a large ASPX.Net - VB.Net web application (around 35-40 pages)
that
once the user logs in, I need to direct them to the correct page,
depending
on what they select from the directory. In other words...when they
login,
if they are a new user, a new account screen comes up and from there a
series of screens need to be entered in a specific order. 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.

I know this can be done, we do it all the time when doing things such as
ordering books, or any type of on-line shopping. 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?

Please Help! Any info would be GREATLY appreciated!

TIA,

Coleen


Sep 6 '06 #10

This discussion thread is closed

Replies have been disabled for this discussion.