MessageBox is a windows form control. Visual web developer is for web forms. Rendering happens on the client machine; so the message box does not work. Looking at your snippet you are wanting to report some error to back to the users browser. What i typically do for this is to have a custom validator that sits silently on the page and set it up so it does not have text and its display is none. Along with this validator you add a validation summary to the page. To activate the error reporting in your try catch block set the IsValid property to false and the ErrorMessage property to your exception message on the custom validator.
Sample code to set error message on screen
Code:
catch ex as Exception
custvalException.IsValid = false
custValException.ErrorMessage = "some message" 'ErrorMessage displays in validation summary
End try