Emailid
Password
         
  
    Forgot password

New user Sign Up


Demo Program in classic ASP and ASP.NET.

       Current Rating:  40%                                                     Total Members Rated:  1
                                                                     Send To Friend

  

Demo Program in classic ASP and ASP.NET.

 

 

Introduction

 

Here the demo program is devised to amplify and display a number. The number will keep increasing because the number value is stored in SQL Server and is shared between classic ASP and ASP.NET in spite of which page is loaded.

 

How to make the Demo Program?

 

a. Generate a new virtual directory called Demo play.

 

b. Form the SessState table (osql.exe -E -d SessionDemoDb -i Session.sql).

 

c. Fashion a new database called SessionDemoDb.

 

d. Spin off ASP Session under the ASP configuration tab.

 

e. Reproduce the web.config, testPage.aspx, Global.asa, testPage.asp, and GlobalInclude.asp to the virtual directory.

 

f. Bring up to date the DSN string setting in the Global.asa and web.config. The session timeout setting is optional. The default is 20 minutes. 

 

g. Set up the SessionUtility.dll into the Global Assembly Cache (gacutil /i SessionUtility.dll).

 

h. Depict the SessionUtility.dll as a COM object using the regasm.exe (regasm.exe SessionUtility.dll /tlb:SessionUtility.tlb).

 

i. Endow the IUSR_<machine_name> account to have read and execute access to the SessionMgr.dll.

 

j. Duplicate the SessionManager.dll to a local directory and use regsvr32.exe to register it (regsvr32 SessionManager.dll).

 

 

How to execute the Demo Program?

 

a. Begin Microsoft® Internet Explorer.

 

b. Fill the testPage.asp for classic ASP. The number "1" should appear in the Web page.

 

c. Connect refresh on Internet Explorer to reload the page. The number should be increased.

 

d. Alter the URL to testPage.aspx for ASP.NET. The number should keep progressing.

 

e. This procedure is repeated by starting the testPage.aspx page primarily.

 

How to integrate the COM Object in an ASP?

 

By including a file in the beginning of each script to share common codes and constants ASP applications are developed. The best way to incorporate the custom session object is to add the instantiation code in the common include file. The last step is simply to replace all reference to the session object with the custom session variable name. It happens generally here.

 

Drawback

 

1. Here, this solution will not support an existing ASP application that stores a COM object in the Session object.

 

2. In this case, a custom marshaler is needed to serialize/deserialize the states in order to use the custom session object.

 

3. Also, this solution does not support storing type arrays of the string.

 

 

Recovery

 

1. This feature can be implemented by using the Microsoft® Visual Basic® 6.0 Join function to combine all of the array elements into a single string before storing it into session object with some additional effort.

 

2. The overturn can be done using the Visual Basic 6.0 Split function to split the string back to individual array elements. On the .NET Framework side, the Join and Split methods are members of the String class.

 

Ending

 

Although porting from ASP to ASP.NET is not a simple process, the better programming model and improved performance of ASP.NET will make the conversion process worthwhile. The approach described in this article offers a solution that will make the migration process simpler with the exception of storing a COM object in the Session object. ASP.NET represents a new programming paradigm and architecture, and offers many advantages over classic ASP.


                           Rate This Article:   

Author is Offline
  Author: Hesus Oliver Pecce
       


Comments Posted
Label
Subject Author Status Date

All the best!!!

Ausef Machaino 27/06/2008

Good article

Boroto Meida 04/07/2008

 

Post Comment

Related Articles
N-Tier in ASP.NET or other .NET apps
Software Development Outsourcing (Offshore ) to India
Make your web site ‘perfect and Search Engine Friendly for Google and Yahoo
Color combination of your Web site
An appealing design for your Web site



Home | About Us | Site Map | Privacy Policy