HI,

I keep getting this error -

"Object reference not set to an instance of an object"

Does anyone know how to trap the exact error location, or at least get a more informative error message?

Here is an example of my code where the error seems to be happening but everything looks okay to me
VB Code:
  1. Private Sub cmdSubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSubmit.Click
  2.         Dim sMsg As String = ""
  3.         Try
  4.             If LCase(txtEdit.Text) = "true" Then
  5.                 Response.Redirect("complete.aspx?display=pro_edit")
  6.             End If
  7.  
  8.         Catch ex As Exception
  9.             ' Record any exceptions and exit
  10.             sMsg = "The following exception occurred: Submit<br />" + ex.Message.ToString
  11.         End Try
  12.  
  13.         If sMsg <> "" Then
  14.             Message.Visible = True
  15.             Message.Text = sMsg.ToString
  16.         End If
  17.     End Sub

Cheers Al