1、通过URL链接地址传递 
(1) send.aspx代码

protected void Button1_Click(object sender, EventArgs e) 

Request.Redirect("Default2.aspx?username=honge"); 

(2) receive.aspx代码

string username = Request.QueryString["username"];//这样可以得到参数值。 

2、POST方式传递 
(1) send.aspx代码

<form id="form1" runat="server" action="receive.aspx" method=post> 
<div> 
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" /> 
<asp:TextBox ID="username" runat="server"></asp:TextBox> 
</div> 
</form> 

(2) receive.aspx代码

string username = Ruquest.Form["receive"]; 

3、Session方式传递 
(1) send.aspx代码

protected void Button1_Click(object sender, EventArgs e) 

Session["username"] = "honge"; 
Request.Redirect("Default2.aspx"); 

(2) receive.aspx代码

string username = Session["username"];//这样可以得到参数值。 

4、Application方式传递 
(1) send.aspx代码

protected void Button1_Click(object sender, EventArgs e) 

Application["username"] = "honge"; 
Request.Redirect("Default2.aspx"); 

(2) receive.aspx代码

string username = Application["username"];这样可以得到参数值。 

5、使用Server.Transfer进行传递 
(1) send.aspx代码

public string Name 

get { 
return "honge"; 


protected void Button1_Click(object sender, EventArgs e) 

Server.Transfer("Default2.aspx"); 

(2) receive.aspx代码

send d = Context.Handler as send ; 
if (d != null) 

Response.Write(d.Name);//这样可以得到参数值。 

ASP.NET 页面之间传递参数方法的更多相关文章

  1. JSP页面之间传递参数的方法有哪些?

    JSP页面之间传递参数的方法有哪些? 解答: 1)request 2)session 3)application 4)提交表单 5)超链接

  2. ASP.NET页面之间传递值的几种方式(转载)

    页面传值是学习asp.net初期都会面临的一个问题,总的来说有页面传值.存储对象传值.ajax.类.model.表单等.但是一般来说,常用的较简单有QueryString,Session,Cookie ...

  3. ASP中页面之间传递值的几种方式

    ASP.NET页面之间传递值的几种方式 页面传值是学习asp.net初期都会面临的一个问题,总的来说有页面传值.存储对象传值.ajax.类.model.表单等.但是一般来说,常用的较简单有QueryS ...

  4. ASP.NET网页之间传递参数与值

    ASP.NET网页之间传递参数与值,方法很多,可以使用Application,Cookie,Session,或是Querystring等等.由于Insus.NET开发的程序中,多数是在后台之间进行参数 ...

  5. ASP.NET页面之间传递值的几种方式

    目录 QueryString Session Cookie Application 一.QueryString QueryString是一种非常简单的传值方式,他可以将传送的值显示在浏览器的地址栏中. ...

  6. [转]ASP.NET页面之间传递值的几种方式

    页面传值是学习asp.net初期都会面临的一个问题,总的来说有页面传值.存储对象传值.ajax.类.model.表单等.但是一般来说,常用的较简单有QueryString,Session,Cookie ...

  7. [转载]ASP.NET页面之间传递值的几种方式

    页面传值是学习asp.net初期都会面临的一个问题,总的来说有页面传值.存储对象传值.ajax.类.model.表单等.但是一般来说,常用的较简单有QueryString,Session,Cookie ...

  8. 在两个ASP.NET页面之间传递变量【转】

    ASP.NET提供了事件驱动编程模型,使开发者简化了应用程序的总体设计,但是这个也造成了它固有的一些问题,例如,在传统的ASP里,我们可以通过使用POST方法很容易地实现页面间传递变量,同样的事情,在 ...

  9. ASP.NET 页面之间传递值的几种方式

    1.使用QueryString,  如....?id=1; response. Redirect().... 2.使用Session变量 3.使用Server.Transfer4.Applicatio ...

随机推荐

  1. (16)break和continue

    #(1)这里顺带说下pass # pass 过 的意思,防止代码报错,就是个占位的, if True: # 不允许代码块里面的内容为空,用pass占位 pass #(2)break (只能用在循环当中 ...

  2. mysql 模糊查询 concat()

    concat() 函数,是用来连接字符串. 精确查询: select * from user where name=”zhangsan” 模糊查询: select * from user where ...

  3. [Groovy] Private fields and methods are not private in groovy

    如题,, 具体介绍请参看: http://refaktor.blogspot.com/2012/07/private-fields-and-methods-are-not.html

  4. C#工具类之字典扩展类

    using System; using System.Collections; using System.Collections.Generic; using System.Linq; using S ...

  5. form组件之modelForm

    modelForm的使用及参数设置 从modelForm这个名字就能看出来,这个form是和模型类model有知己诶关联的,还是以数和出版社的模型来说明: models.py(模型) from dja ...

  6. pacemaker +corosync高可用

    server1:yum install pssh-2.3.1-2.1.x86_64.rpm  crmsh-1.2.6-0.rc2.2.1.x86_64.rpm -yyum install -y pac ...

  7. Binutils工具集常用工具

    GNU为GCC编译器提供了配套的辅助工具集(Binutils)http://www.gnu.org/software/binutils/ 1. addr2line ①将指定地址转换为对应的文件名和行号 ...

  8. java——时间复杂度、动态数组

    O(n)不一定小于O(n^2),要具体来看,而我们说的这种时间复杂度其实是渐进时间复杂度,描述的是n趋近于无穷的情况. 动态数组的时间复杂度: 添加操作:O(n) addLast()的均摊复杂度为O( ...

  9. 安装 Office project 2013 时提示找不到 Office.zh-cn\OfficeLR.cab

    昨天在安装project 时总是弹出下图中的提示框,在网上搜索了很多办法但是没有解决这个问题. 后来进入到office.zh-cn的文件夹中,在officemui.msi文件中右键卸载,然后在重新安装 ...

  10. regular expression, grep (python, linux)

    https://docs.python.org/2/library/re.html re.match(pattern, string, flags=0)  尝试从字符串的起始位置匹配一个模式 re.s ...