I have a web application based on vb.net
I used MsgBox() in my MYPage.aspx.vb where my expectation is that the user on client should click on a button and based on it I would process further.
But I heard a suggestion the MsgBox() is working fine in my code cause on developer machine(my dev box) webserver is running locally. This does not work on a remote web server or in any hosted environment outside of a local server.
Is this true?
Yes. Server side code is executed on the server. The VB.NET Code Behind is executed on the server. You were seeing it on your development station because the server and client were the same machine.
If someone else were to browse to your server from another client, the dialog box would appear on the server and the user would never see it.
If you need to do a confirmation to the user, you need to use some sort of clientside code, like JavaScript and
confirm.