Re: can't get control to hold state



I found another problem. It seems that when I try to access the values
in my click event, they are empty and when the page renders, they don't
appear in the textboxes. But, if I don't try to access the values in
the click event, then the textboxes hold state. So, the following code
doesn't hold state...

protected void lb1_Click(object sender, EventArgs e)
{
Response.Write(lb.Username + " " + lb.Password + " " +
lb.RememberMe);
Response.Write("yo");
}

....and this does...

protected void lb1_Click(object sender, EventArgs e)
{
//Response.Write(lb.Username + " " + lb.Password + " " +
lb.RememberMe);
Response.Write("yo");
}

Why? BTW, if you're following the code, I changed the CheckRemember
property to RememberMe so it was a little clearer for the end user.

.



Relevant Pages