I just want to add to Sanjib65 response.
You have to use JavaScript to display a "MsgBox" in ASP.NET
MsgBox isn't going to work very well for you. You could force it to use MsgBox (quite easily) but in order for MsgBox to work it has to use the Windows.Forms message box component. In order to use this component you'll have to run an ActiveX component in your web page.
ActiveX components only run in Internet Explorer and they are commonly prevented from running because they access the client's operating system. This can be very dangerous: the ActiveX control could be malicious in nature and anything from the web should be considered unsafe. Even if the ActiveX control is not malicious, it could be insecure and could open security vulnerabilities just by sitting on the client's computer.
So, ActiveX controls are always advised against. In a secure, well designed web application, web page should never be accessing the operating system. Especially if it's something as simple as displaying a message window.
JavaScript is a client-side scripting language that runs in the web browser. It does things that the server can't, like displaying a message box.
To display a message box using JavaScript you use:
alert().
So, if your page doesn't validate you need to display a JavaScript alert with the message that you want to display to the user.
Please check out this article on
how to use JavaScript in ASP.NET for more information.
Please know that it is easy to get around JavaScript (client-side) validation.
You should Always validate data provided by the user server side.
-Frinny