Well, you asked if there was an easier way... The Membership and Role providers make authentication and authorization much easier, and are worth looking into.
Anyway, when you redirect to the Login page (done automatically with the .NET security features), you can pass in the current page in the QueryString (also done automatically with the .NET security features). You can do this by looking at Request.RawUrl
Then in the login age, when login succeeds you can take a look at the query string and redirect the user to the page they initially requested. (You never guess: this is also taken care of by the built-in security features.... ;) OK, I'll stop now.... ;) )
Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of
ASP.NET 2.0 Instant Results and
Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.