Showing a modal dialog box or form when the application is not running in UserInteractive mode
Hi all I am getting this error when my site was in live when trying to show print preview dialog
PrintPreviewDialog ppdlg = new PrintPreviewDialog(); ppdlg.ShowDialog();
How can I resolve this 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 application.
In asp.Net, you can't use PrintPreviewDialog class because it's part of windows form. The asp.net code runs on the server side.
If you want to popup a print dialog with asp.net, you have to do it on client side.