newcomer2006 Posted July 2, 2006 Share Posted July 2, 2006 hi, everyone,When I want to dispaly a message box using C#.net (vs.net 2003), I found this error:"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. "My code is: MessageBox.Show("OK!");Can some one help me? thanks in advance! Link to comment Share on other sites More sharing options...
aspnetguy Posted July 2, 2006 Share Posted July 2, 2006 You cannot use MessageBox in an ASP.Net project only Windows Projects.use this instead string js = "<script>alert('OK!')</script>";this.RegisterStartupScript("keyName",js); Link to comment Share on other sites More sharing options...
newcomer2006 Posted July 2, 2006 Author Share Posted July 2, 2006 It does work! Thank you very much!Another question is can I use LoginMessage.Text() in C#.net? Link to comment Share on other sites More sharing options...
aspnetguy Posted July 3, 2006 Share Posted July 3, 2006 when you say C#.net are you refereing to ASP.Net webforms made with C# or C# Windows Forms?If it is for webforms then no. You cannot use alot of dialog commands, etc on webforms. All popup boxes/messageboxes/confirmation boxes, etc must be done with JavaScript. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now