开发者

Gateway Page Between ASP and an ASP.NET Page

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 om开发者_运维问答itted 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!


Found this the other day that pretty much would handle what I was trying to do:

http://msdn.microsoft.com/en-us/library/aa479313.aspx

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜