Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...in dnn 4.7, after button click  action , msg box should be displayed  but it displays the foll errorin dnn 4.7, after button click action , msg box should be displayed but it displays the foll error
Previous
 
Next
New Post
1/8/2008 4:16 AM
 

on clicking content link, aspx page is displayed in content pane,from that page after some action is performed it redirects to various pages dynamically.in  the mean time after  a particular button click  action , message box should be displayed  but it displays the following error.

Any one who have suggestions or solutions.pls reply.Thanks in advance.

Server Error in '/DNN' Application.

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.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: 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.

Source Error:

Line 74:         scmd.ExecuteNonQuery()
Line 75: sc.Close()
Line 76: MsgBox("Your REPAIR ID is " & x)
Line 77: sc.Open()
Line 78: 'scmd.CommandText = "Insert into userlogon values('" & createdby & "','" & TextBox2.Text & "','" & TextBox3.Text & "','" & TextBox4.Text & "'," & Val(TextBox5.Text) & "," & Val(TextBox6.Text) & ",'" & TextBox7.Text & "','" & TextBox8.Text & "'," & x & ")"

Source File: C:\DNN\Repairs.aspx.vb    Line: 76

Stack Trace:

[InvalidOperationException: 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.]
System.Windows.Forms.MessageBox.ShowCore(IWin32Window owner, String text, String caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, Boolean showHelp) +1801570
System.Windows.Forms.MessageBox.Show(IWin32Window owner, String text, String caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options) +26
Microsoft.VisualBasic.Interaction.MsgBox(Object Prompt, MsgBoxStyle Buttons, Object Title) +544
_Default.LinkButton1_Click(Object sender, EventArgs e) in C:\DNN\Repairs.aspx.vb:76
System.Web.UI.WebControls.LinkButton.OnClick(EventArgs e) +105
System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +107
System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +174
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102


Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42

 

 
New Post
1/8/2008 5:45 AM
Accepted Answer 

You are trying to use a WinForms specific command (msgbox) in an asp.net environment, which is not allowed (this is exactly what the error also says)

if you want a message box to appear at client side, you should use javascript to show the message. You could do something like response.write("<script type='text/javascript'>a l e r t('Your repair id is: " + id.tostring + "') </script>")

Remove extra spaces in a l e r t (put there to prevent js filtering)


Erik van Ballegoij, Former DNN Corp. Employee and DNN Expert

DNN Blog | Twitter: @erikvb | LinkedIn: Erik van Ballegoij on LinkedIn

 
New Post
1/8/2008 7:56 AM
 

Thanks erik van, using codes that u gave viz.

Response.Write("<script > )</script>")

the >Cannot find server or DNS Error
Internet Explorer

 

 
New Post
1/8/2008 8:40 AM
 

actually if i keep )</script>")

Redirect code which i used: Response.Redirect("http://localhost/dnn/Home/tabid/36/Default.aspx")

pls reply

 

 

 
New Post
1/8/2008 10:14 AM
 

I don't understand what you are saying here.

the bottom line is: you are not coding for winforms, but for asp.net. The msgbox command is not allowed in asp.net.

You can use inline messages like this: response.write("mymessage"), you can use a label on the control, and set that label to a value, you can open a javascript alert on your page, and there a lot of other ways to do what you want. You might want to get a basic book on asp.net, to figure out the basics.. (your question is not really dotnetnuke specific)


Erik van Ballegoij, Former DNN Corp. Employee and DNN Expert

DNN Blog | Twitter: @erikvb | LinkedIn: Erik van Ballegoij on LinkedIn

 
Previous
 
Next
HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...in dnn 4.7, after button click  action , msg box should be displayed  but it displays the foll errorin dnn 4.7, after button click action , msg box should be displayed but it displays the foll error


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out