All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
Ajax无刷新实现图片切换特效_.net资料_编程技术
实例详细讲解PHP连接调用数据库的方法_php资料_编程技术
详细讲解PHP的Jmai组件及发送邮件实例_php资料_编程技术
利用UrlRewrite,asp.net动态生成htm页面(补充说明)_[Asp.Net教程]
为ASP.NET,MVC开发一些常用插件(一)——导航栏_[Asp.Net教程]
php获得二维或多维数组的第一维的长度_php资料_编程技术
SqlServer教程:SqlServer中各数据类型的长度、精度_[SQL Server教程]
PHP技术:txtSQL安装手册中文版_[PHP教程]
ASP.NET实现文件的在线压缩和解压缩_[Asp.Net教程]
如何删除SQL Server日志?_[SQL Server教程]
Reading number is top 10 pictures
A man's favorite things3--ZhouWeiTong
牛奶和人奶哪个好?
贩卖儿童者必须判死刑
NeedWallpaper12
大年初五接财神
Look at the Spring Festival people crowded into the what kind
India's national beauty of the college students
Chinese paper-cut grilles art appreciation2
Sora aoi on twitter2
传销的好处
Download software ranking
Unix video tutorial9
网络管理员第三版
Jinling thirteen stock
Sora aoi - one of more PK
Unix video tutorial15
I for your crazy
Tram sex maniac 2 (H) rar bag11
Unix video tutorial10
Ashlynn Video3
艳兽都市
delv published in(发表于) 2014/1/27 6:45:25 Edit(编辑)
.NET内置对象之Request对象_[Asp.Net教程]

.NET内置对象之Request对象_[Asp.Net教程]

.NET内置对象之Request对象_[Asp.Net教程]

Request对象是HttpRequest类的一个实例,它提供对当前页请求的访问,其中包括请求标题、Cookie、客户端证书、查询字符串等,你可以使用此类来读取浏览器已经发送的内容。
新建一个网站,包括两个网页,代码如下:
1、Default.aspx代码:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>



Request对象








onClick="Button1_Click" />




Default.aspx.cs代码:
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;


public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Application["id"] = TextBox1.Text;
}
protected void Button1_Click(object sender, EventArgs e)
{
Response.Redirect("Default2.aspx?id=" + TextBox1.Text.Trim() + "");
}
}
2、Default2.aspx代码:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>





读取与传值





接受页面传值,请注意浏览器地址栏!!!







Default2.aspx.cs代码:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;


public partial class Default2 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Label1.Text = Page.Request.QueryString["id"].ToString();
Response.Write(Request.Browser.Platform);
Response.Write("
");
Response.Write(Request.MapPath("Default2.aspx"));
Response.Write("
");
Response.Write(Request.UserHostAddress);
Response.Write("
");
Response.Write(Request.Url.OriginalString);
Response.Write("
");
Response.Write(Request.RawUrl);
Response.Write("
");
Response.Write(Request.QueryString);
Response.Write("
");
Response.Write(Request.HttpMethod);
Response.Write("
");
Response.Write(Request.UserHostAddress);
Response.Write("
");
Response.Write(Request.UserAgent);
Response.Write("
");
}
}







添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.