This question is locked. New answers and comments are not allowed.
I was reading thru the OpenAccess documentation and found 2 ways of dealing with the context in ASP.Net.
1) Using Master Pages (easier to implement)
2) Using HttpModule (by far more complicated and I could not even get it working as per Telerik examples online)
Master Pages way is super easy to implement however what happens if I do not use Master pages? So I tried on a regular .aspx page to override both the OnInit and Dispose methods and created a private variable to hold the context (pretty much the exact same way as what goes in the code of the Master Page approach).
As follows:
private WebContext context;
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
this.context = new WebContext();
}
public override void Dispose()
{
base.Dispose();
this.context.Dispose();
}
So this works just as good as using the Master Page approach. However since Telerik does not mentions this approach I was wondering maybe something really wrong is going to happen down the line. Or maybe I am being too paranoid. Anyone could let me know if this 3rd approach is a big NO-NO? Or if is just as ok as the Master Page approach? If so then why would someone in their right mind even consider the HttpModule approach (I could not even get it working on my end).
1) Using Master Pages (easier to implement)
2) Using HttpModule (by far more complicated and I could not even get it working as per Telerik examples online)
Master Pages way is super easy to implement however what happens if I do not use Master pages? So I tried on a regular .aspx page to override both the OnInit and Dispose methods and created a private variable to hold the context (pretty much the exact same way as what goes in the code of the Master Page approach).
As follows:
private WebContext context;
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
this.context = new WebContext();
}
public override void Dispose()
{
base.Dispose();
this.context.Dispose();
}
So this works just as good as using the Master Page approach. However since Telerik does not mentions this approach I was wondering maybe something really wrong is going to happen down the line. Or maybe I am being too paranoid. Anyone could let me know if this 3rd approach is a big NO-NO? Or if is just as ok as the Master Page approach? If so then why would someone in their right mind even consider the HttpModule approach (I could not even get it working on my end).