How to pass values across the pages in ASP.net without using Session
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"];
Cookies
SET :
HttpCookie cookName = new HttpCookie("Name");
cookName.Value = "Pandian";
GET :
string name = Request.Cookies["Name"].Value;
Application Variables
SET :
Application["Name"] = "pandian";
GET :
string Name = Application["Name"].ToString();
Refer the full content here : Pass values from one to another
Note:
for the cookies, and the Application. Especial the Application is not working if you use webgarden or webfarm !. And the application variables are a simple Dictionary<> that exist only for compatibility with the old asp and is not to be used. Also the cookies are not for transfer data from page to page like that. Very bad design, not good practice.
How to pass values across the pages in ASP.net without using Session的更多相关文章
- Creating Help Pages for ASP.NET Web API -摘自网络
When you create a web API, it is often useful to create a help page, so that other developers will k ...
- Razor Pages with ASP.NET Core 2
With ASP.NET Core 2 we get another way of building web applications. It’s one of those new things th ...
- [RxJS] Implement RxJS `mergeMap` through inner Observables to Subscribe and Pass Values Through
Understanding sources and subscribers makes it much easier to understand what's going on with mergeM ...
- Introduction to Razor Pages in ASP.NET Core
https://docs.microsoft.com/en-us/aspnet/core/mvc/razor-pages/ 从ASP.NET Core 2.0.0版本之后,添加了新的特性Razor p ...
- [Angular 2] Passing Template Input Values to Reducers
Angular 2 allows you to pass values from inputs simply by referencing them in the template and passi ...
- Transferring Data Between ASP.NET Web Pages
14 July 2012 20:24 http://www.mikesdotnetting.com/article/192/transferring-data-between-asp-net-web- ...
- Customizing Site-Wide Behavior for ASP.NET Web Pages (Razor) Sites
Customizing Site-Wide Behavior for ASP.NET Web Pages (Razor) Sites By Tom FitzMacken|February 17, 20 ...
- 使用ASP.NET Web API Help Pages 创建在线接口文档
操作步骤 1.新建Web API项目 2.在项目Areas文件夹下找到以下文件,取消注释图中代码. 3.右键解决方案,属性,如图设置. 4.运行程序,点击右上角API 接口列表: 详情-无参数: 详情 ...
- Demystifying ASP.NET MVC 5 Error Pages and Error Logging
出处:http://dusted.codes/demystifying-aspnet-mvc-5-error-pages-and-error-logging Error pages and error ...
随机推荐
- 005/搭建fabric环境(一)
一.安装虚拟机VMware 参考博客:https://blog.csdn.net/u013142781/article/details/50529030 Step1:下载ubuntu镜像 (约1.8G ...
- Log4net使用(二)
转:http://www.cnblogs.com/basilwang/archive/2006/06/09/421868.html Log4net同时按照日期和大小生成RollingFile和访问Sy ...
- C#中Func与Action的理解
Action 与 Func是.NET类库中增加的内置委托,以便更加简洁方便的使用委托.最初使用委托时,均需要先定义委托类型,然后定义一个符合委托类型签名的函数,在调用前,需声明并创建委托对象,将指定函 ...
- X86平台下用汇编写"HelloWorld"
首先需要安装一个汇编器,我用的是Nasm,这个汇编器在Linux下安装还是很简单的. Nasm下载地址http://www.nasm.us/pub/nasm/releasebuilds/ 在下载之后对 ...
- 《剑指offer》面试题20 顺时针打印矩阵 Java版
我的方法:遇到这种题最好在纸上画一画打印路线.我利用了4个标志left.top.right.bottom,表示当前需要打印的左界.上届.右界和下界,换句话说这些界线之外的已经打印了,如此一来判断结束的 ...
- 一台电脑关联多个git账号
一台电脑连接多个git账号 现需要一台电脑连接gitlab,github,码云,之前的操作时,用公司账号,在这几个地方都注册一遍,导致自己就有两类号,一个自己的,一个公司的,这样也是可以,但总是不太好 ...
- window.onload和document.ready的区别
window.onload和document.ready虽然两个方法的运行效果都一样,但他们之间是存在着区别的: 一.从执行的时间 window.onload在dom文档结构加载完毕以后就可以执行,不 ...
- python常用函数 Y
yield有点像return,但他会在下一次执行的时候从上次结束点继续执行,带有 yield 的函数在 Python 中被称之为 generator(生成器),生成器无法通过索引获取数据,同时也承诺使 ...
- openGL图形渲染管线
在OpenGL中,任何事物都在3D空间中,而屏幕和窗口却是2D像素数组,这导致OpenGL的大部分工作都是关于把3D坐标转变为适应屏幕的2D像素.3D坐标转为2D坐标的处理过程是由OpenGL的图形渲 ...
- Oracle Internals Notes Redo Write Triggers
There are four conditions that cause LGWR to perform a redo write. When LGWR is idle, it sleeps on a ...