110,555
社区成员
发帖
与我相关
我的任务
分享
<body>
<form id="form1" method="post" action="Default.aspx" runat="server">
<div>
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
<asp:Label ID="Label2" runat="server" Text="Label"></asp:Label>
<asp:Label ID="Label3" runat="server" Text="Label"></asp:Label>
<asp:TextBox ID="txtName" runat="server"></asp:TextBox>
<asp:TextBox ID="txtPwd" runat="server"></asp:TextBox>
<asp:ImageButton ID="ImageButton1" runat="server" />
</div>
</form>
</body>
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string a = "";
if (!IsPostBack)
{
this.Label1.Text = "a";
}
else
{
this.Label1.Text = "b";
}
if (Request.Form["txtName"] != null)
{
this.Label2.Text = Request.Form["txtName"];
}
if (Request.Form["txtPwd"] != null)
{
this.Label3.Text = Request.Form["txtPwd"];
}
}
}
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string a = "";
if (!IsPostBack)
{
this.Label1.Text = "a";
}
else
{
this.Label1.Text = "b";
if (Request.Form["txtName"] != null)
{
this.Label2.Text = Request.Form["txtName"];
}
if (Request.Form["txtPwd"] != null)
{
this.Label3.Text = Request.Form["txtPwd"];
}
}
}
}