I have just noticed that there are many blocks of code like this:
int pageID = 0;
if (HttpContext.Current.Request.Params["pageid"] != null)
{
if (HttpContext.Current.Request.Params["pageid"] != string.Empty)
{
try
{
pageID = Int32.Parse(HttpContext.Current.Request.Params["pageid"]);
}
catch { }
}
}
Why not use the special functions in this case:
int pageID = 0;
if (!string.IsNullOrEmpty(HttpContext.Current.Request.Params["pageid"]))
{
Int32.TryParse(HttpContext.Current.Request.Params["pageid"], out pageID);
}
or just
int pageID;
Int32.TryParse(HttpContext.Current.Request.Params["pageid"], out pageID);
?