Vb.net – Error while showing a modal dialog box or form


I am checking emailId exists in DB, If Exists
I am looking to create a Ok/Cancel confirmation dialog.
if user say "Ok" I am redirecting to some other form.

My code is :

If emailId = True Then
    If MsgBox("Your email address exists in our database. Click OK to update your   Details.", MsgBoxStyle.Information + MsgBoxStyle.OkCancel, Title:="NJ Golf Resort") = MsgBoxResult.Ok Then
        Response.Redirect("~/articles.asp?a=" & a & "&b=" & b )
    End If
End If

for above code i m getting error :

Showing a modal dialog box or form
when the application is not running in
UserInteractive mode is not a valid
operation. Specify the
ServiceNotification or
DefaultDesktopOnly style to display a
notification from a service

Best Answer

I think this is a website code in ASP.Net, and what you are trying to do is display msgbox on server, this can not be done as the user is interacting with the web browser on client side, you may better use javascript to dispaly msgbox


Related Topic