Gateway Page Between ASP and an ASP.NET Page
Posted
by ajdams
on Stack Overflow
See other posts from Stack Overflow
or by ajdams
Published on 2009-12-17T15:49:14Z
Indexed on
2010/05/09
5:38 UTC
Read the original article
Hit count: 549
I'll admit, I am pretty new with ASP .NET programming and I have been asked to take all our gateway pages (written in classic ASP) and make one universal gateway page to the few C# .NET applications we have (that I wrote). I tried searching here and the web and couldn't find much of anything describing a great way to do this and figured I was either not searching properly or was not properly naming what I am trying to do.
I decided to to take one of the main gateway pages we had in classic ASP and use that as a base for my new gateway. Without boring you with a bunch of code I will summarize my gateway in steps and then can take advice/critique from there.
EDIT: Basically what I am trying to do is go from a classic ASP page to a ASP .NET page and then back again.
EDIT2: If my question is still unclear I am asking if what I have an the right start and if anyone has suggestions as to how this could be better. It can be as generic as need-be, not looking for a specific off-the-shelf code answer.
My Gateway page:
In the first part of the page I grab session variables and determine if the user is leaving or returning through the gateway:
Code (in VB):
uid = Request.QueryString("GUID")
If uid = "" Then
direction = "Leaving"
End If
' Gather available user information.
userid = Session("lnglrnregid")
bankid = Session("strBankid")
' Return location.
floor = Request.QueryString("Floor")
' The option chosen will determine if the user continues as SSL or not.
' If they are currently SSL, they should remain if chosen.
option1 = Application(bankid & "Option1")
If MID(option1, 6, 1) = "1" Then
sslHttps = "s"
End If
Next I enter the uid into a database table (SQL-Server 2005) as a uniqueidentifier field called GUID. I omitted the stored procedure call.
Lastly, I use the direction variable to determine if the user is leaving or returning and do redirects from there to the different areas of the site.
Code (In VB again):
If direction = "Leaving" Then
Select Case floor
Case "sscat", "ssassign"
' A SkillSoft course
Response.Redirect("Some site here")
Case "lrcat", "lrassign"
' A LawRoom course
Response.Redirect("Some site here")
Case Else
' Some other SCORM course like MindLeaders or a custom upload.
Response.Redirect("Some site here")
End Select
Session.Abandon
Else
' The only other direction is "Returning"
.....
That's about it so far - so like I said, not an expert so any suggestions would be greatly appreciated!
© Stack Overflow or respective owner