covo and MHermann,
Many thanks for your help. The day after I wrote this, I had the opportunity to look at some
of the other topics on this site only to discover that I had missed the one called "Migrating from ASP to ASP.NET", which would have been a more appropriate place for this question. Prior to starting this project, I have looked at many training materials only to"re-discover" that the books and videos make it look much easier than it really is, at least when first starting out. What I think would really be nice is too find a book that covers the "beginning therory" less and the "how to" more. I already have enough books that cover the therory. My biggest problem is not knowing what has changed, and understanding when and how to use the new events and procedures.
For the benefit of the others in the community, what I have learned up to this point is posted below . . . a kind of "Here are the problems you will encounter and how to fix them approach" MHermann, you may want to read the part on session variables.
Again many thanks for your help,
Graham
What you can Expect
From what I have found out so far, moving from ASP to .Net is going to involve more work than I initially thought. For a site that has 20 or 30 pages, this may not be an issue, but for a company with several hundred, it will be.
Although the 2 will run side by side with one another, session varaibles can not be directly passed between them. (See #1C).
For the pages that contain mixed script, especially those containing many "<% %>" tags, I found it easier to rewrite them than to try and upgrade.
Pages that are pure asp, seem to transfer with only a few modifications
ASP.NET is much more like programming in VB 5. I am finding that I have to think more about properties and events than I do the linear flow of the script. The trick seems to be learning what they are and knowing when to use them. Once you do, it becomes MUCH EASIER over the previous way of doing it.
My Posted Questions Answered: (Please see my original Post for the complete question)
1. Session Variables
(a) Session Variable Support - .Net will recognize Session Variables. This problem disappeared for me when I found the fix to #2a. (I added "Imports Microsoft.VisualBasic" to the Globals.asax file.)
(b) Passing Session Variable from ASP to .Net - Since you can't pass session variables directly (??who's idea was this??), you will need to pass it off somehow. The better(and more secure) way would be to transfer the Session variable to a hidden field on a form, then have the .Net page pick it up. The second method would be to pass it in the Querystring.
If you need to keep the varialbe in .Net, don't store it back to another session variable. Instead, declare it as a Global variable in the [Session Start] section of the Globals.asax.vb file. Here is how I did mine:
Public Class Global
Inherits System.Web.HttpApplication
Public Shared AccountID As String
..
..
..
Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs)
AccountID = System.Web.HttpContext.Current.Request.QueryString("AccountID")
' Fires when the session is started
End Sub
..
..
..
End Class
(c) The 2 will run side by side, but you will most likely have to do some tweaking to make it work.
2. Missing Objects and VB Functions
(a) The unrecognized VB Functions were corrected when I added the following line to the head of the Globals.asax file.
Imports Microsoft.VisualBasic
(b) Forget about using the Session.CreateObject command to reference a DLL. Instead, create the reference the same way you do in VB 5. You will find it in the Solution Explorer for your project.
2. Include files
(a) and (b) It appears that using includes are discouraged in .Net. They will work, but they do create warnings in your compile(at least they are in mine). The correct place to put them is into a User Control.
3. Using Proper Methods and Techinque
I am still unsure on a lot of this, so I am going to let you use your best judgement. Perhaps someone with more knowledge than I would be willing to complete this section for us.
The newest of these (for me) is the WebConfig file? It appears that you can also set global variables here, but I am not sure if it is the proper place. I would love to know if there is a Wizard or GUI that will assist me in making changes to it. If Visual Studio has one, I have yet to find it.
www.DoctorRecovery.com