Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As _
System.EventArgs) Handles Button1.Click
Try
Process.Start("http://www.microsoft.com")
Catch ex As Exception
MsgBox("Can't load Web page" & vbCrLf & ex.Message)
End Try
End Sub
If you are making a web app, instead of MsgBox just drop a Label on your page, and set it's Text property to a string that summarizes what the error is about in user-friendly terms. So, you'd have something like this:
Catch ex As Exception
Label1.Text = "You can't vote twice"
End Try
Draak
Participant
816 Points
126 Posts
Re: Violation of PRIMARY KEY constraint 'PK_Awards'. Cannot insert duplicate key in object 'dbo.A...
Jun 02, 2010 06:12 PM|LINK
Here's the general syntax:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As _ System.EventArgs) Handles Button1.Click Try Process.Start("http://www.microsoft.com") Catch ex As Exception MsgBox("Can't load Web page" & vbCrLf & ex.Message) End Try End SubIf you are making a web app, instead of MsgBox just drop a Label on your page, and set it's Text property to a string that summarizes what the error is about in user-friendly terms. So, you'd have something like this:
Catch ex As Exception Label1.Text = "You can't vote twice" End TryAntony Highsky About Me