在.net的页面与asp的也面中可以传递session
来源:互联网 发布:sniffer pro软件安装 编辑:程序博客网 时间:2024/05/13 04:49
<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>
- 在.net的页面与asp的也面中可以传递session
- [Classic ASP]实现session在页面之间的传递
- 在ASP.NET页面间传递任意数据的方法与实例
- 在ASP.NET页面间传递任意数据的方法与实例
- 在ASP.NET页面间传递任意数据的方法与实例
- 在两个ASP.NET页面之间传递值的方法
- 在ASP.NET中实现页面间的参数传递
- 在ASP.NET中实现页面间的参数传递
- 在ASP.NET中实现页面间的参数传递
- 在ASP.NET中实现页面间的参数传递
- 【C#.NET】ASP.NET中实现页面间的参数传递 QueryString\Application\Session\Cookie
- ASP.NET中实现页面间的参数传递 QueryString/Application/Session/Cookie (转载)
- ASP.NET中实现页面间的参数传递 QueryString/Application/Session/Cookie (转载)
- ASP.NET中实现页面间的参数传递 QueryString/Application/Session/Cookie
- ASP.NET中实现页面间的参数传递 QueryString/Application/Session/Cookie
- ASP.NET中实现页面间的参数传递 QueryString/Application/Session/Cookie
- ASP.NET页面间参数的传递
- asp.net页面传递的集中方法
- Andrew Zisserman
- Visual Geometry Group
- 数据库表中列类型的修改和ALTER的用法
- 摆渡自己
- 吃拉面
- 在.net的页面与asp的也面中可以传递session
- 甲骨文CEO:有史以来最狂妄的演讲(中英文)
- 如何在LISTBOX中移动鼠标就可以起到CLICK的作用
- 分手快乐---(哪个更好呢)
- 微软技术资料相关的链接。
- 异常处理(一、前言)
- 异常处理(二、C语言的异常处理)
- 笔记本相关链接
- 刚才装了下VS 2005 Team,原来这个IDE仅仅是比较好玩而已,完全用不了