{
protected void Page_Load(object sender, EventArgs e) {
Label1.Text = Session[\} }
3、在ex_3_1.aspx.cs文件中的代码如下所示: public partial class _ex_3_1 : System.Web.UI.Page {
protected void Page_Load(object sender, EventArgs e) {
HttpCookie cookie1 = Request.Cookies[\if (cookie1 == null) {
//创建一个cookie实例
HttpCookie cookie = new HttpCookie(\
//添加要存储的信息,采用键/值结合的方式 cookie.Values.Add(\
cookie.Expires = DateTime.Now.AddYears(1);
//把cookie加如当前的页面的Response对象里面 Response.Cookies.Add(cookie);
Response.Redirect(\} else {
Response.Write(cookie1.Values[\} } }
Chap04参考答案 一、填空题
1、System.Web.UI.WebControls
2.设置是否自动向服务器发送数据 false
用户单击此控件时并不导致向服务器发送页面。 3.编程方式 运行时更改页面中的文本 4.标头 标题 链接 链接 5.图像 作用点控件的集合 二、1.D 2.B 3.D 4.C 5.D 三、上机操作题
1、在ex4_1.aspx文件中代码如下所示: <%@ Page Language=\AutoEventWireup=\Inherits=\
CodeFile=\1.0
Transitional//EN\