VB Style Message Box from .Net application

admin

Administrator
Staff member
Hi,

I need to call a vb style message box in my application. Based on the confirmation, we have to delete the record.

See my code:

If (MsgBox("Are you sure?", MsgBoxStyle.OKCancel)) = MsgBoxResult.OK Then
--Delete the Record
End If

But it displays the below error message.

It is invalid to show a modal dialog or form when the application is not running in UserInteractive mode. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application.

Kindly suggest me. It is urgent.

Thanks,
Siva RYou are going to have to use javascript to create the box, asp.net cannot create an alert or a new window as it is run server side. You might just display the message on the screen since not everyone has js enabled.
 
Back
Top