UserInteractive Mode

A

Amaryllis

Hello,

I'm trying to check for changes made to a textbox before exiting a
page. If there are changes made, I'm using a messagebox to ask if
the user is sure they want to discard changes made in order to go to
the other page. My problem is that if I try to capture a response, I
get this error messge:

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.

Could someone tell me what this means and if there is a way to get
around this?


Thanks
 
J

John Saunders

Amaryllis said:
Hello,

I'm trying to check for changes made to a textbox before exiting a
page. If there are changes made, I'm using a messagebox to ask if
the user is sure they want to discard changes made in order to go to
the other page. My problem is that if I try to capture a response, I
get this error messge:

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.

Could someone tell me what this means and if there is a way to get
around this?

You are using System.Windows.Forms.MessageBox. You cannot use anything from
System.Windows.Forms within a Web Form.

Also, I strongly suggest that you abandon the idea of duplicating this sort
of rich client functionality in a web form. If you do, you will find
yourself on a wild goose chase.

If you insist on attempting to duplicate such features, you will need to do
a lot of programming in JavaScript on the client. You will then get to
experience the differences between browsers in their handling of JavaScript.
 
G

Guest

What I've done in the past is create a phony message box using a panel on my web page. I keep it hidden. When I need to pop it up I set the enable property of everything else on the page (easy is everything else is in another panel since you just set the other panels Enable property to false) then I make my Messagebox Panel visible. I then process the OK and Cancel buttons.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,992
Messages
2,570,220
Members
46,805
Latest member
ClydeHeld1

Latest Threads

Top