I have developed an asp.net web application containing 40-50 pages. I have implemented logger using Log4net and each of my pages has this in its page_load event
protected void Page_Load(object sender, EventArgs e)
{
try
{
log.Debug("In Page Load Function");
if (!IsPostBack)
{
if (Session["OrgId"] != null)
{
// my logic
}
else
{
Response.Redirect("Homepage.aspx?Sid=1", false);
}
log.Debug("Page load function successfull");
}
}
catch (Exception ex)
{
log.Error(ex.Message, ex);
}
}
This method has many strings like "In page Load function","OrgId","Homepage.aspx?Sid=1","Page load function successfull"
. Now i would like to maintain these string which are common throughout my application in a seperate class file and use it with a variable...
Can you suggest what class can be used for this or your way of handling this.