第一篇:ASP NET上機報告
實驗一
關(guān)鍵代碼
using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;
namespace WebApplication1.Webs {
public partial class WebForm1 : System.Web.UI.Page
{
protected void Reset_Button_Click(object sender, EventArgs e)
{
TextBox1.Text = “";
TextBox2.Text = ”“;
}
protected void Submit_Button_Click(object sender, EventArgs e)
{
Response.Redirect(”Index.aspx?count=“+TextBox1.Text+”&&pwd=“+TextBox2.Text);
}
} } 運行界面如下:
直接點確認結(jié)果如下:
輸入帳號,不輸入密碼結(jié)果如下:
輸入密碼不輸入帳號,運行結(jié)果如下:
實驗二
關(guān)鍵代碼
<%@ Page Language=”C#“ AutoEventWireup=”true“ CodeFile=”Default.aspx.cs“ Inherits=”anli3_Default“ %>