I
Ilyas
Hi all
I have the following in my aspx:
<asp:TextBox runat="server" ID="txt1" EnableViewState="false" /+
<asp:TextBox runat="server" ID="txt2" />
=
<asp:Label runat="server" ID="lblResult" />
<br /><br />
<asp:Button runat="server" ID="btnAdd" OnClick="btnAdd_Click"
Text="Add" />
and in my code behind I have:
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btnAdd_Click(object sender, EventArgs e)
{
lblResult.Text = (int.Parse(txt1.Text) + int.Parse
(txt2.Text)).ToString();
}
When I enter 1 in the first box and 2 in the second, then click the
add button I get the answer appearing but the first textbox still
remembers the number entered even though I said
EnableViewState="false"
I dont want the first textbox to remember its value across postback -
how can I achieve this?
Thanks
I have the following in my aspx:
<asp:TextBox runat="server" ID="txt1" EnableViewState="false" /+
<asp:TextBox runat="server" ID="txt2" />
=
<asp:Label runat="server" ID="lblResult" />
<br /><br />
<asp:Button runat="server" ID="btnAdd" OnClick="btnAdd_Click"
Text="Add" />
and in my code behind I have:
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btnAdd_Click(object sender, EventArgs e)
{
lblResult.Text = (int.Parse(txt1.Text) + int.Parse
(txt2.Text)).ToString();
}
When I enter 1 in the first box and 2 in the second, then click the
add button I get the answer appearing but the first textbox still
remembers the number entered even though I said
EnableViewState="false"
I dont want the first textbox to remember its value across postback -
how can I achieve this?
Thanks