Get Http Code from HttpException
<%@ Page Language="vb" %> <html> <head> <script runat="server"> Sub Page_Load() Try Server.Execute("Foo.aspx") Catch HttpEx As HttpException Message.Text = "ERROR:</br>" Message.Text &= "Http Status Code: " & _ HttpEx.GetHttpCode() & "</br>" End Try End Sub </script> </head> <body> <asp:label id="Message" forecolor="red" runat="server"/> </body> </html>