<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ Register Namespace="WebControlLibrary" Assembly="WebControlLibrary" TagPrefix="sample" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
void Button1_Click(object sender, EventArgs e) {
demoLabel.Text = TextBox1.Text;
demoLabel.TextInViewState = TextBox2.Text;
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>使用视图状态ViewState</title>
</head>
<body style="font-size: small;">
<form id="form1" runat="server"> <div> 姓名:
onclick='"Button1_Click"' html> body>< form>< div> < <sample:LabelInViewState 以下输出来自LabelInViewState:<br <br ><br > Text='"提交"' <asp:Button 邮箱:<asp:TextBox > runat='"server"></asp:TextBox><br'>