I created the following extension method:
public static bool HasHostAndUrl(this HttpSessionStateBase session)
{
return session["CurrentUrl"] != null && session["CurrentHost"] != null;
}
I also have the following that appears in my code. Is it possible I could make this into an extension method also:
string.Format("http://{0}{1}",
Session["CurrentHost"],
new Uri((string)Session["CurrentUrl"]).PathAndQuery)
Do you want something like this?