怎么使得asp和asp.net的session信息 共享

jxh97111 2003-12-23 03:22:06
请各位帮帮忙,
如有代码更好,谢谢!
...全文
50 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
online 2004-01-27
  • 打赏
  • 举报
回复
How to Share Session/Application State Across Different ASP.NET Web Applications

http://www.asp101.com/articles/jayram/sharestate/default.asp
online 2004-01-27
  • 打赏
  • 举报
回复
http://www.microsoft.com/china/community/Column/47.mspx
webdiyer 2004-01-27
  • 打赏
  • 举报
回复
Transfer Session Variables from Classic ASP to ASP.NET

http://www.eggheadcafe.com/articles/20021207.asp
dcogili 2004-01-27
  • 打赏
  • 举报
回复
只能通过cookie
acewang 2004-01-27
  • 打赏
  • 举报
回复
???
kingastar 2004-01-26
  • 打赏
  • 举报
回复
有个简单的办法
一个转换asp中session的到asp.net的session的方法
<TITLE>ASPPage1.asp</TITLE>
<%
' This is the page where we just set some Classic ASP Session Variables
' ASPPage2.asp is where the work is done.
Session("username")="joeblow"
session("email")="joe@blow.com"
Session("userid")=2
Session("DestPage")="Finalpage.aspx"
Server.Transfer("ASPPage2.asp")
%>
==========================================================================

<TITLE>ASPPage2.asp</TITLE>
<%
' We graf all the session variable names/values and stick them in a form
' and then we submit the form to our receiving ASP.NET page (ASPNETPage1.aspx)...
Response.Write("<form name=t id=t action=ASPNETPage1.aspx method=post >")
For each Item in Session.Contents
Response.Write("<input type=hidden name=" & Item)
Response.Write( " value=" & Session.Contents(item) & " >")
next
Response.Write("</FORM>")
Response.Write("<script>t.submit();</script>")
%>

============================================================================
<TITLE>ASPNETPage1.aspx</TITLE>
<%@ Page language="c#" %>
<script runat=server>
// We iterate through the Form collection and assign the names and values
// to ASP.NET session variables! We have another Session Variable, "DestPage"
// that tells us where to go after taking care of our business...
private void Page_Load(object sender, System.EventArgs e)
{
for(int i=0;i<Request.Form.Count;i++)
{
Session[Request.Form.GetKey(i)]=Request.Form[i].ToString();
}
Server.Transfer(Session["DestPage"].ToString(),true);
}
</script>
==============================================================================

<TITLE>FinalPage.aspx</TITLE>
<%@ Page language="c#" %>
<script runat=server>
// This page is just a "proof of concept page"...

private void Page_Load(object sender, System.EventArgs e)
{
Response.Write("Shared Session Variable Names/Values between Classic ASP and ASP.NET:<BR>");
for (int i = 0; i < Session.Contents.Count; i++)
{
Response.Write("Assigned to \"" +Session.Keys[i].ToString()+"\"");
Response.Write(" Value: "+ Session[i].ToString() +"<BR>");
}
}
</script>
acewang 2003-12-23
  • 打赏
  • 举报
回复
How to Share Session State Between Classic ASP and ASP.NET
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/converttoaspnet.asp

62,073

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧