I believe 90% of programs are visuals. Mean they learn quick by examples. I have a form on step1.aspx
When I click the button I do a server.transfer (step2.aspx, true)
If I use click the previous button I have in step2.aspx it calls a
server.transfer (step1.aspx, txt). In my page_load of step1.aspx the following
is declared:
string Email = (string)Session["txtEmail"];
My definition in step1.aspx
<asp:TextBox id="txtEmail" runat="server" width="150px" maxlength="60"></asp:TextBox>
Now if I want to populate or set (keep) the textbox value to what
the user entered, what should I do. I can see the value of Email, by doing a Response.Write(Email);
Now, I just have to make sure that the textbox is not empty.
I tried the following:
<script language="C#" runat="server">
// Define String Email
public String Email {
get {
return txtEmail.Text;
}
set {
txtEmail.Text = value;
}
}
and
public String Email {
get {
return txtEmail.Text;
}
Still I get nothing? What am I doing wrong? I appreciate any assistance.
I am finally learning slowly asp.net.
Thank you.