How does the Asp.net system coexist with the traditional ASP system?

Source: Internet
Author: User

Recently, I was working on integrating an Asp.net (1.1) system (system A) with an old ASP system (system B). Using the same database, I have some experience in integration. Here we will record it for your reference.

The key here is the session. The session in. Net cannot be shared with the session in ASP (the same is true for applications ). System A and system B have database connection strings (both Application variables) and user IDs (both session variables ). How can we use the database connection string of system A in system B? First, the database connection string and user ID are retrieved in Asp.net and stored in the <input type = "hidden"> Field of the client, and then transmitted to the traditional ASP page, here, we can extract the required variable values and send them to the session variables of ASP for use on the ASP page. So that Asp.net and traditional ASP systems can coexist.

<% @ Page Language = "C #" codebehind = "Redirect. aspx. cs" autoeventwireup = "false" %>

<Input type = hidden name = "userid" value = "<% = session [" userid "]. tostring () %>">

<Input type = hidden name = "flag" value = "<% = request [" flag "]. tostring () %>">

<Input type = hidden name = "strconnection" value = "<% = application [" udlfilepath "]. tostring () %>">

<Script language = JavaScript>

<! --

If (document. All. Flag. value = "1 ")

Window. Location. Replace ("bbs_shorttop.asp? Userid = "+ document. All. userid. Value +" & connection = "+ document. All. strconnection. value );

Else if (document. All. Flag. value = "2 ")

{

Window. Location. Replace ("bbs_companydesktop.asp? Userid = "+ document. All. userid. Value +" & connection = "+ document. All. strconnection. value );

}

Else if (document. All. Flag. value = "3 ")

Window. Location. Replace ("bbs_topten.asp? Userid = "+ document. All. userid. Value +" & connection = "+ document. All. strconnection. value );

Else if (document. All. Flag. value = "4 ")

Window. Location. Replace ("bbs_colmanageframe.asp? C = 001009 & userid = "+ document. All. userid. Value +" & connection = "+ document. All. strconnection. value );



// -->

</SCRIPT>

This code is the middle layer connecting two systems

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.