CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML

Free Download:




Zone: > NEWSGROUP > Asp.Net Forum > migration_to_asp.net.migrating_from_asp_to_asp.net Tags:
Item Type: NewsGroup Date Entered: 3/25/2004 7:19:33 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 0 Views: 41 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
4 Items, 1 Pages 1 |< << Go >> >|
DoctorRecovery
Asp.Net User
Migrating ASP to .Net (General Questions)3/25/2004 7:19:33 PM

0/0

I am in the proess of converting my site over to .Net and have found myself slammed against the wall by things that appear to be common issues for many others. I would like to throw out several questions in order to get clarificaiton and make sure that I am going in the right direction. I am hoping that many of them are just syntax issues that will be easy to correct. My thanks and appreciation for the guidence that anyone may be able to provide.

Graham


1. Session Variables

(a) From what I have read, .NET does not support Session Variables. If this is true, then I may have alot of work to do. {not what I was hoping :O( } What should I use in .Net to replace the Session Variables in ASP?

(b) In the old asp scripts, a common piece of code is: If Session("AccountID") = "" then . . . redirect the user to the login screen. As I understand it, this variable cannot directly be passed to the .Net Page. My thoughts are to pass this using the querystring. Is this the right approach or is there a better way to do this?

(c) I need to run the 2 side by side, at least for a while. Is there a way to make the "Session part of ASP" work in .Net, or am I going to have to rewrite whole thing?

2. Missing Objects and VB Functions

(a) Functions such as Len, Trim, Left, IsObject do not work. My guess is that I am missing a reference to library that contains these functions. How do I set this in .NET?

(b) The site also uses the Session.CreateObject command to refreence a DLL File that was created in house using VB 5 SP 6.

Set oEdits = Server.CreateObject("NDWeb.DataEdits")

How do I properly reference this in .NET?

2. Include files

The Legacy pages in ASP use a common set of include files for the page header, footer, Drop-Down Menu, and frequendly used javascript.

(a) It appears that includes are discouraged in .Net. Since these scripts touch practically all of the pages on the site, I would like to migrate them last. Is this possible to use these for both sides or will I need to make a new version for .Net?

(b) What is the proper location to reference these files in .Net? At present, they are included at the top of the aspx page. Should it be moved into a User Control?


3. Using Proper Methods and Techinque

(a) I am a little unsure on how to properly use the Globals file. How do I declare a global variable or object here. (such as a connection to my SQL Server database)

(b) .Net appears to like the includes in JavaScript, but not asp? Do I need to make this a class or something? If so How?

(c) When do I use the WebConfig file? Is there a GUI that will assist me in this?


Again, my sincerest thanks,

Graham






www.DoctorRecovery.com
covo
Asp.Net User
Re: Migrating ASP to .Net (General Questions)3/25/2004 8:15:03 PM

0/0

1. Session Variables

(a) .Net support sessions variables and the support is way better than in regular ASP. However, the session variables can not be (easly) shared between the 2 applications; although there are some articles around that explain how to do it.

(b) .Net provides all the old ways + new ways to pass information aroung. You CAN pass it with Session Variables, but you can use what ever you want.

(c) There are articles about sharing Sessions... but you would have to look for them; I can't remember where they are ;)

2. Missing Objects and VB Functions

Programming in .Net is totally different. You need to erase from your mind all the spagetti kind of code you are used to write and think objects.

The .Net framework provides literaly tousands of libraries for you to use... The string object in particular provides "Lenght", "Trim", "Substring", etc.

It is hard to "migrate your mind" to .Net, but once you do it, you won't want to go back.

I recommend you pick up some Object Oriented Programming books.


3. Include files

No more including files in .Net. Instead we have UserControls, that are portions of reusable functionatily included into controls so they can be included and reused in many pages.

As opose to regular include files, when you create UserControls you can interact with them as if they were objects... Its pretty cool actually.

Notice that Client side include files are still necessary (CSS, Javascripts).

4. Using Proper Methods and Techinque

There are a lot of discussions about the right way to use the right resources. Here is more your needs than anything what should decide....

(a) The Global in .Net is something that is run when the application starts, it can be use to set application variables and resources... But is not necessary to use. It's really your call. The Global after all is a public class.

(b) Javascript is client side... ASP is server side. No server side file can be included. Use a UserControl

(c)The Web config file is use to store application settings and global variables. The use of the web config file varies from affecting the behavior of your application to just store application constants (like a ConnectionString for example).


Graham, overall you are asking about everything in .Net. Pick up a book and open your mind to the world of object oriented programming and you'll understand better.

I hope this helps,
Covo
http://covodev.blogspot.com/

"Everything should be made as simple as possible, but not simpler", A. Einstein
mhermann
Asp.Net User
Re: Migrating ASP to .Net (General Questions)3/26/2004 1:12:11 PM

0/0

Well, I am in the process of looking into your question #1 regarding passing session variables between ASP and ASP.net. I have come accross the following 2 articals.

http://www.eggheadcafe.com/articles/20021207.asp

and

http://searchvb.techtarget.com/vsnetTip/1,293823,sid8_gci951935_tax293033,00.html

Now I am a noob overall. I have done some work with asp.net and little to none in asp. In my current project I need to pass the username and passsword from an asp application to an asp.net application. The asp application is a third party app and I am writing the asp.net app. I don't fully understand the articals posted above but I am working on it.

Hope those help. keep this thread in mind if you find anything else as I could use it as well.
DoctorRecovery
Asp.Net User
Re: Migrating ASP to .Net (General Questions)3/29/2004 9:41:34 PM

0/0

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
4 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
ASP.NET Unleashed Authors: Stephen Walther, Pages: 1488, Published: 2003
MCAD Developing and Implementing Web Applications with Microsoft Visual C#(TM) . NET and Microsoft Visual Studio(R) . NET Exam Cram 2 (Exam Cram 70-315): Exam Cram 2, McAd Exam 70-315 Authors: Kirk Hausman, Amit Kalani, Priti Kalani, Ed Tittel, Pages: 555, Published: 2003
ASP.net Web Developer's Guide: Web Developer's Guide Authors: Robert Patton, Mesbah Ahmed, Jonothon Ortiz, Wei Meng Lee, Pages: 736, Published: 2002
Professional ASP.NET 1.0: Updated and Tested for Final Release of ASP.NET V.1.0 Authors: Richard Anderson, Alex Homer, Dave Sussman, Karli Watson, Pages: 1354, Published: 2002
Webmaster's Guide to the Wireless Internet Authors: Ryan Fife, Wei Meng Lee, Pages: 0, Published: 2001
.Net Mobile Web Developers Guide: Web Developer's Guide Authors: Steve Milroy, Wei Meng Lee, Shelly Powers, ebrary, Inc, Ken Cox, Laura Barker, Doug Safford, Amit Kalani, Pages: 407, Published: 2002
Pro ASP.NET 2.0 E-commerce in C# 2005 Authors: Paul Sarknas, Pages: 617, Published: 2006
Expert ASP.NET 2.0 Advanced Application Design: Advanced Application Design Authors: Dominic Selly, Andrew Troelsen, Tom Barnaby, Pages: 459, Published: 2005
Intelligent and Active Packaging for Fruits and Vegetables Authors: Charles L. Wilson, Pages: 360, Published: 2007
MCAD/MCSD.NET: Developing and Implementing Web Applications with Visual Basic.NET and Visual Studio.NET Authors: Mike Gunderloy, Pages: 1104, Published: 2003

Web:
ASP.NET Forums
Migrating to ASP.NET For information on migrating from platforms other than ASP or ASP.NET as well as general migration questions, see the ASP.NET Development Center for ...
PHP to ASP.NET Migration Assistant - Getting Started If you have questions or feedback on the Migration Assistant, please visit the PHP to ASP.NET Migration Assistant Alpha forum. For general questions about ...
Asp.net Migration // BlogCatalog Topic // BlogCatalog A complete collection of AJAX interview questions,Free AJAX ebooks along with AJAX control toolkit ... NET Migration Moving from Visual Basic 6 to Visual Basic .NET The . ... Posted by acousticguitarist in General Discussion. 12 replies ...
CodeProject: Page Transition Class - ASP to ASP.NET Migration ... Jul 4, 2005 ... Page Transition Class - ASP to ASP.NET Migration. By StylezHouse .... General News Question Answer Joke Rant Admin ...
Migrating to ASP.NET 2 - Part 5 - It's the Little Things - Or Why ... May 16, 2006 ... NET Framework in general and ASP.NET 2.0 and Visual Web Developer in ... Feel free to post any comments, remarks or questions you may have ...
ASP .NET: Migration and Interoperability May 30, 2006 ... ASP .NET: Migration and Interoperability, Hits: 757 ... Java/Tips and Tutorials/ General Java/Frequently Asked Questions ...
Migrating from ColdFusion to ASP NET General ASP NET Questions - 16. Views: 270 From: fenildesai ยท J7jph29l29774-tiny .... challenges while migrating coldfusion in to .net ...
ASP.NET Questions | .NET Questions NET Quest Search Engine. Search ASP.NET Questions Articles, Blogs, Information ... Download 1) General questions of SQL SERVER Which command using Query Analyzer will ... From: Migrating from Cold Fusion to ASP>NET - ASP.NET - 7/31/ 2007 ...
Wiley::Migrating to LINQ to SQL in TheBeerHouse and ASP.NET 2.0 ... Jumping from ASP to ASP.NET. General Web Site Development ... If you have any questions about these restrictions, you may contact Customer Care at (877) ...

Videos:
The Coptic Church: 1,8 Million Christians embraced islam On aljazeera TV 6/2/2008: The Coptic Church in Eygept testifies that 1,8 Million arab Christians embraced Islam in the last 36 years.. Bishop ...
The Coptic Church: 1,8 Million Christians embraced islam On aljazeera TV 6/2/2008: The Coptic Church in Eygept testifies that 1,8 Million arab Christians embraced Islam in the last 36 years.. Bishop ...
Is Quran could be read as Bible! recited or memorised Obaid Karki An Outcast Spinoziste Pantheon Hexalingual Automath Former UAE Under Secretary Independant Street-Knowledge Urban Talkshow Guru ...
investigateislam caught red handed use Saudi Government Docs Obaid Karki An Outcast Spinoziste Pantheon Hexalingual Automath Former UAE Under Secretary Independant Street-Knowledge Urban Talkshow Guru ...
Youtube Code of Conduct " for Muslims and others of course " Obaid Karki An Outcast Spinoziste Pantheon Hexalingual Automath Former UAE Under Secretary Independant Street-Knowledge Urban Talkshow Guru ...
django: Web Development for Perfectionists with Deadlines Google TechTalks April 26, 2006 Jacob Kaplan-Moss ABSTRACT Django is one of the premier web frameworks for Python, and is often compared ...
Youtube Code of Conduct " UpDownMostly " Obaid Karki An Outcast Spinoziste Pantheon Hexalingual Automath Former UAE Under Secretary Independant Street-Knowledge Urban Talkshow Guru ...




Search This Site:










dynamically populate control in the desktopdefault

select all

ftb 2.0 and dnn2b2

class diagrams

installing asp .net 1.1

inserting the date...

error in reading csv files...

compiler error message: bc30002: type 'classifiedshttpapplication' is not defined

error in web.config after building in asp.net 2.0 final

vs 2005 and possible copy website bug

aspnet_regsql.exe - sqlserver setup wizard

i have problem with user login , please help me

can you have private menus?

working c#

problem with authentication

disable automatic inclusion of stylesheets

how to refresh page programmically ?

tree view auto format produces broken images

edit problem

excel

why can't i use webite/asp.net configuration/security to in my computer? who can help me?

application error

aspnet_regsql

setting up vs2005 to use sql server 2005

unrecognized attribute 'verb'. when using allow/deny

no list for time zones?

web.config cannot load after impersonate=true

insert data into access

webparts and anonymous access.

customized skins

 
All Times Are GMT