Mega Code Archive

 
Categories / ASP.Net Tutorial / Development
 

Convert Exception to string

<%@ Page Language="vb" EnableSessionState="false" %> <html> <head>    <script runat="server">       Sub Page_Load()          Try             Session("foo") = "Foo"          Catch HttpEx As HttpException             myMessage.Text = "ERROR:</br>"             myMessage.Text &= "String Representation of Exception: " & _                HttpEx.ToString() & "</br>"          End Try       End Sub    </script> </head> <body>    <asp:label id="myMessage" forecolor="red" runat="server"/> </body> </html>