如何通过跨在ASP.net页面值,而无需使用Session [英] How to pass values across the pages in ASP.net without using Session

查看:134
本文介绍了如何通过跨在ASP.net页面值,而无需使用Session的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想提高我的门户网站的性能。我使用的会话存储状态信息。

I am trying to improve performance of my web portal. I'm using Session to store state information.

但是我听说使用会话会降低应用程序的速度。是否有任何其他的方式来传递值跨页在asp.net中。

But I heard that using session will decrease the speed of the application. Is there any other way to pass values across the page in asp.net.

推荐答案

您可以从一个页面由以下值传递给另一个..

You can pass values from one page to another by followings..

Response.Redirect
Cookies
Application Variables
HttpContext

的Response.Redirect

SET:

Response.Redirect("Defaultaspx?Name=Pandian);

GET:

string Name = Request.QueryString["Name"];

饼干

SET:

HttpCookie cookName = new HttpCookie("Name");
cookName.Value = "Pandian"; 

GET:

string name = Request.Cookies["Name"].Value;

应用程序变量

SET:

Application["Name"] = "pandian";

GET:

string Name = Application["Name"].ToString();

从一个值传递给另一个:

下面参见全部内容

这篇关于如何通过跨在ASP.net页面值,而无需使用Session的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆