public partial class PZ : System.Web.UI.Page
{
bool Commited;
protected void Page_Load(...)
{
if (!IsPostBack)
{
Cache["Transaction"] = Admin.Conn.BeginTransaction["PZ"];
Commited = false
}
}
protected void Save_Click(...)
{
SqlTransaction t = (SqlTransaction)Cache["Transaction"];
if (t != null)
t.Commit();
Commited = true;
}
}
I don't know where to put Rollback code. I cannot do it in Page_Unload
because page is reloaded because of list box control.
Could you give me some suggestion how to do it?
Thank you
/RAM/