R
Robert Rotstein
I have a homework assignment to create a simple web site and, in certain
circumstances, to alter the default sequence of pages displayed -- for
instance, if the user attempts to visit a page before being
authenticated, he is to be directed to a special page, instead of the
default login page. My approach has been to intercept page requests in
Global.Application_BeginRequest(), see which page is being requested,
and do either a Server.Transfer() or Response.Redirect(), or nothing at
all. While this has been mostly successful, it has unfortunately led to
a vast proliferation of flags, checks, copying of the Session object
into Global, having utility methods in other classes set fields in
Global -- a big, unwieldy mess, which means that it is surely wrong.
Can someone give me a hint on what is the basic approach, the mechanism
to use, to have this application gain complete control over the page
sequencing?
circumstances, to alter the default sequence of pages displayed -- for
instance, if the user attempts to visit a page before being
authenticated, he is to be directed to a special page, instead of the
default login page. My approach has been to intercept page requests in
Global.Application_BeginRequest(), see which page is being requested,
and do either a Server.Transfer() or Response.Redirect(), or nothing at
all. While this has been mostly successful, it has unfortunately led to
a vast proliferation of flags, checks, copying of the Session object
into Global, having utility methods in other classes set fields in
Global -- a big, unwieldy mess, which means that it is surely wrong.
Can someone give me a hint on what is the basic approach, the mechanism
to use, to have this application gain complete control over the page
sequencing?