ASP.NET基础
来源:互联网 发布:python pdf下载 编辑:程序博客网 时间:2024/04/30 06:44
元素的ID值是给DOM用的,NAME值是给服务器用的.
获取文件在服务器的路径:
string fullPath = context.Server.MapPath("Hello2.htm");
读取文件内容:
string content = System.IO.File.ReadAllText(fullPath);
判断字符串是否为空或空值:
string.IsNullOrEmpty(username);
隐藏字段:
<input type="hidden" name="ispostback" value="true" />
只有设定了name的input、textarer、select的value属性值才会被提交给服务器。
在aspx的Page指令区加上EnableViewState="false".内网系统,互联网的后台可以心情的用ViewState.
写入Cookie:
Response.SetCookie(new HttpCookie("Color",TextBox1.Text));
读取Cookie:
Label1.Text = Request.Cookies["Color"].Value;
ashx调用Session:
要继承:IRequiresSessionState这个类;
写入Session:
Session["第一个值"] = DateTime.Now;
Session["第二个值"] = 300;
读取Session:
Button2.Text = Convert.ToString(Session["第一个值"]) + Session["第二个值"];
- ASP.NET基础
- ASP.Net基础备忘
- ASP.Net基础
- ASP。NET基础记录
- ASP。NET基础记录
- ASP.NET基础试题
- ASP.NET学习 基础
- Asp.net 基础
- Asp.net 基础
- ASP.NET基础
- Asp.Net MVC基础
- Asp.net MVC3基础
- asp.net基础代码
- ASP.net基础
- ASP.NET基础(1)
- ASP.NET基础(2)
- ASP.NET基础(3)
- ASP.Net基础(4)
- php中socket的使用
- JQuery 用法 函数 选择器
- android移植后反复重启
- Lucene.net初探
- wpf添加一行
- ASP.NET基础
- 关于网站的优化
- Normalization VS Denormalization
- [转贴]三把方向法
- Android电源管理系统调研报告-(2)
- 中国概念股的诚信伤不起
- ASP.NET MD5加密
- 或导致后续中国公司上市推迟
- c# 正则表达式