The web will not support showing a messagbox this way. The C# code runs on the server and generates HTML which is sent to the client and then the browser renders the HTML. If you want to show a message to the user you need to use JavaScripts
alert[
^] or use a jQuery plugin.