试题详情
单项选择题You create a Web Form. The Web Form allows users to calculate values and display the results in a label named lblResults. You need to capture all unhandled exceptions on the Web Form through the Error event. The Error event must capture each unhandled exception and display it on the Web Form. Which code segment should you use? ()

A、Protected Sub Page_Error(ByVal sender As Object, _ ByVal e As System.EventArgs) Handles Me.Error lblResults.Text = e.ToString() e = NothingEnd Sub

B、Protected Sub Page_Error(ByVal sender As Object, _ ByVal e As System.EventArgs) Handles Me.Error lblResults.Text = Server.GetLastError().ToString() Server.ClearError()End Sub

C、Protected Sub Page_Error(ByVal sender As Object, _ ByVal e As System.EventArgs) Handles Me.Error Response.Write(e.ToString()) e = NothingEnd Sub

D、Protected Sub Page_Error(ByVal sender As Object, _ ByVal e As System.EventArgs) Handles Me.Error Response.Write(Server.GetLastError().ToString()) Server.ClearError()End Sub

  • D
  • 关注下方微信公众号,在线模考后查看

热门试题