just Declare HttpWebResponse httpRes globally
public partial class _Default : System.Web.UI.Page
{
HttpWebResponse httpRes;
protected void Page_Load(object sender, EventArgs e)
{
try
{
httpRes = (HttpWebResponse)httpReq.GetResponse();
}
catch
{
if (httpRes != null)
Label1.Text = httpRes.StatusDescription;
}
}
}