Hi,
I wrote a class with a variable which value is modified although
there's no responsible statement, as I see.
Below the code - the class is a user control.
public partial class BooksiDataList : System.Web.UI.UserControl
{
private string ChangedISBN;
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
ChangedISBN = null;
}
protected void BooksList_Edit(object sender, DataListCommandEventArgs
e)
{
ChangedISBN = ((Label)e.Item.FindControl("BooksListISBN")).Text;
// here ChangedISBN != null
}
protected void BooksList_Update(object sender,
DataListCommandEventArgs e)
{
if (ChangedISBN != null) // HERE PROBLEM: ChangedISBN == null
...
ChangedISBN = null;
}
}
BooksList_Update is called always after BooksList_Edit - which sets
'ChangedISBN' to non-empty string. But in BooksList_Update ChangedISBN
is always null.
Could you explain me this phenomena?
Thank you very much
/RAM/