protected void MyList_UpdateCommand(object source, DataListCommandEventArgs e) { int id = int.Parse(((Label)e.Item.FindControl("lbl_id")).Text); string value = ((TextBox)e.Item.FindControl("txt_name")).Text; string script = ((TextBox)e.Item.FindControl("txt_adscript")).Text; AdsBLL.Update_Script(id, value, script); // refresh ad update script HttpContext.Current.Application["a" + id] = AdsBLL.Fetch_Ad_Script(id); Config.ShowMessageV2(msg, "Record updated successfully", "Success!", 1); MyList.EditItemIndex = -1; BindList(); }