Click to See Complete Forum and Search --> : VB Style Message Box from .Net application


rskshiva
01-27-2005, 06:25 AM
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 R

PeOfEo
01-27-2005, 08:57 PM
You 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.