Doing some refactoring I found the following code:
if (HttpContext.Current.Items.Contains("CurrentPage"))
{
HttpContext.Current.Items["CurrentPage"] = currentPage;
}
else
{
HttpContext.Current.Items.Add("CurrentPage", currentPage);
}
Are there some reasons for not just
HttpContext.Current.Items["CurrentPage"] = currentPage;
?