隐藏域就是在get和post表单元素的时候把一些元素不想让用户直接看到,就需要使用隐藏域来实现
1 <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="EditUser.aspx.cs" Inherits="CZBK.ItcastProject.WebApp._2015_5_29.EditUser" %> 2 3 <!DOCTYPE html> 4 5 <html xmlns="http://www.w3.org/1999/xhtml"> 6 <head runat="server"> 7 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> 8 <title></title> 9 </head> 10 <body> 11 <form id="form1" runat="server"> 12 <div> 13 用户名:<input type="text" name="txtName" value="<%=EditUserInfo.UserName %>" /><br /> 14 密码:<input type="text" name="txtPwd" value="<%=EditUserInfo.UserPass %>" /><br /> 15 邮箱:<input type="text" name="txtMail" value="<%=EditUserInfo.Email %>" /><br /> 16 <input type="hidden" name="txtId" value="<%=EditUserInfo.Id %>" /> <!-- 隐藏域的示例--> 17 <input type="hidden" name="txtRegTime" value="<%=EditUserInfo.RegTime %>" /> 18 <input type="submit" value="编辑用户" /> 19 </div> 20 </form> 21 </body> 22 </html>