Adding function modules with Asp.net in the original ASP program makes sharing sessions a difficult issue. The following describes a simple method to share session sessions in ASP and Asp.net.
Log on to the page and use C # to recreate it. After Successful Logon, run the following statement:
Response. Write ("<script language = 'javascript '> window. Open ('aspxtoasp. aspx', 'new'); </SCRIPT> ");
Open aspxtoasp. on the ASPX page, set action to aspxtoasp. ASP, you can post the session value to the ASP page. Because it is one-way transmission, you do not need to repeat the action on other pages. After testing, the transfer is successful!
The aspxtoasp. aspx code is as follows:
<Script language = "C #" runat = "server">
Response. Write ("<form name = T id = T action = aspxtoasp. asp method = post> ");
Foreach (object it in session. Contents)
{
Response. Write ("<input type = hidden name =" + It. tostring ());
Response. Write ("value =" + session [it. tostring ()]. tostring () + "> ");
}
Response. Write ("</form> ");
Response. Write ("<SCR" + "ept> T. Submit (); </scr" + "ept> ");
</SCRIPT>
The aspxtoasp. ASP code is as follows:
<%
For I = 1 to request. Form. Count
Session (request. Form. Key (I) = request. Form (I)
Next
Response. End
%>
<Script language = "JavaScript">
Window. Close ();
</SCRIPT>