I've the following code:
protected Dictionary<NpInfoHelper, object> Informer;
protected override void OnInit(EventArgs e)
{
if (Session.Keys.Count == 1)
{
Session.Abandon();
Response.RedirectPermanent("~/Pages/Login?e=true", true);
}
else
{
Informer = (Dictionary<NpInfoHelper, object>)Session["Informer"];
}
base.OnInit(e);
}
in every backend .cs
file of the .aspx
file.
I think this is repetitive. Note that I'll be using Informer
in every .aspx.cs
file.
The above code is repeated 19 times. Can I make it just one?