CMIIW : It's only work in Microsoft Visual Studio Designer, not in IIS.
I searched in Google how to create Msgbox and I found it.
Public Sub UserMsgBox(ByVal F As Object, ByVal sMsg As String)
Dim sb As New StringBuilder()
Dim oFormObject As System.Web.UI.Control = Nothing
sMsg = sMsg.Replace("'", "\'")
sMsg = sMsg.Replace(Chr(34), "\" & Chr(34))
sMsg = sMsg.Replace(vbCrLf, "\n")
sb = New StringBuilder()
For Each oFormObject In F.Controls
If TypeOf oFormObject Is HtmlForm Then
oFormObject.Controls.AddAt(oFormObject.Controls.Count, New LiteralControl(sb.ToString()))
Catch ex As Exception
Protected Sub CmdPrint_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles CmdPrint.Click
If CmbCCY.SelectedIndex <= 0 Then
UserMsgBox(Me, "Currency ID is not Selected.")
You have to configure IIS to support ASP.Net for the Msgbox code to work. Is your IIS configured for ASP.Net?
As far as I know, MsgBox is located in System.Windows namespace, but ASP.Net is located in System.Web namespace. So the environment is different.
But, If you could run it, please show to me how to configure your IIS.