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 ...
随机推荐
- 003/node.js--代理服务(解决跨域问题)
业务描述: 1.web前端发送http请求 2.web后端为https协议 如何保证web前端发送http请求到web后端(跨域问题:域名不一致即跨域), 因此用node.js写了个代理服务,转发前端 ...
- IDEA&GIT应用
IDEA&GIT应用 一.IDEA整合GIT GIT教程:http://www.yiibai.com/git/git_pull.html File->Settings.. 1.从GIT上 ...
- docker搭建一个渗透测试环境 bwapp为例
bwapp是一个渗透测试靶场,他其中中含有100多个Web漏洞 基本涵盖了所有主要的已知Web漏洞,包括OWASP Top 10的各种 首先要去搜索一下 看一下有哪些镜像可以下载 docke ...
- 管理MySQL 从入门到出门
MySQL 中的数据库(Database)就像是一个容器,其中包含了各种对象.例如,数据表(Table).视图(View).存储过程(Stored Procedure)以及触发器(Trigger)等. ...
- 13 (H5*) JS第三天 数组、函数
目录 1:数组的定义和创建方式 2:数组的总结 3:for循环遍历数组 4:数组的案例 5:冒泡排序 6:函数的定义 7:函数的参数 8:函数的返回值 复习 <script> /* * * ...
- web 前端1 拾遗
1.整体布局 三个div header body footer 2.div的居中 width:980px margin:0 auto 3.内联标签 inline #内联 无法使用高度.宽度 block ...
- python之cmd模块
md模块可以用来做交互式shell cmd模块是python中包含的一个公共模块,用于交互式shell和其他命令解释器等的基类,我们可以基于cmd模块自定义我们的子类,实现我们自己的交互式shell ...
- webpack4 es6转换
在webpack里用es6语法, ie浏览器不识别,为了让浏览器识别,需要用到bebal转换; bebal,英文是通天塔 的意思, 我们常说的巴比伦也是这个词;我估计是当初设计者是想用它作为一个沟通e ...
- Airbnb开源 快速搭建企业级BI数据平台
最近在公司做一个数据可视化相关的项目,使用了Airbnb开源维护的企业级BI数据平台superset,相较于tableau这种收费的商业软件,Superset是开源维护的,同时图表的种类和颜值普遍偏高 ...
- python 定义模块作用及分类
python把一个功能的模块归类,简单来说,模块是一个由Python代码组成的文件.模块可以定义函数,类和变量. 模块还可以包括可运行的代码. 1,python模块的作用 提高代码的方便维护 使用模块 ...