C#
- Code: Select all
public class BasePage : System.Web.UI.Page
{
public BasePage()
{
this.Init +=new EventHandler(Page_Init);
}
private void Page_Init(System.Object sender, System.EventArgs e)
{
TransactionMgr.ThreadTransactionMgrReset();
}
}
VB.NET
- Code: Select all
Public Class MyPage
Inherits System.Web.UI.Page
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
TransactionMgr.ThreadTransactionMgrReset()
End Sub
End Class
You will find having a base page can really help out anyway when you find that you need to add functionality to all of your pages.
