Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. prompt message box on web page using C#

prompt message box on web page using C#

Scheduled Pinned Locked Moved C#
csharp
35 Posts 7 Posters 2 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Q quiteSmart

    hi, i haven't seen that error before, but i don't write things just to add a post to my score. I write things when i am sure that it will work. And a proof for that is what the real poster wrote that it worked with him as it worked with me several times before. see what is really giving that error. debug it and see at what line it is going

    T Offline
    T Offline
    Tamimi Code
    wrote on last edited by
    #22

    man jdkulkarni also metion my error !! realy i don't think so.....................

    When you get mad...THINK twice that the only advice Tamimi - Code

    Q 1 Reply Last reply
    0
    • T Tamimi Code

      man jdkulkarni also metion my error !! realy i don't think so.....................

      When you get mad...THINK twice that the only advice Tamimi - Code

      Q Offline
      Q Offline
      quiteSmart
      wrote on last edited by
      #23

      i checked that again now and it worked fine i don't know what is wrong with your code. What version of VS are you using mine is VS 2005 Look, just follow these steps: 1) create a new web application 2) go to the designer 3) add a button 4) double click the button 5) click on the project in the main menu. 6) add reference 7) in the .NET tab go to the System.Windows.Forms and click add 8) go to the source code of ur project. 9) add this name space using System.Windows.Forms 10) in the onClick event of the button write: MessageBox.Show("quiteSmart is very smart "); :) and it will work

      T B 2 Replies Last reply
      0
      • M mohd imran abdul aziz

        Thanks Very much, It worked fantastic!.Thanks once againe I have one more question. Now i am preparing verious master. some of then are very similar. Like branch master(which has branch name and branch description), Unit master(which has unit code and unit description). So i wanted to make one form and based on menu item selection(Bcoz i used asp:menu).so by using navigationurl. i redirect it to corresponding web Page. Is My idea is correct. Or i have to do it other way. Please help. Anyway thanks you once againe

        regards imran khan

        Q Offline
        Q Offline
        quiteSmart
        wrote on last edited by
        #24

        sorry man, i don't work much on ASP, my basic work is C# but i have passed through ASP for my own knowledge only. I am not sure about the answer i will give you but i think that what u said is logic and will work. Hope u get the best out of it. Note: for next time please post the ASP questions in the ASP MessageBoard Good Luck

        M 1 Reply Last reply
        0
        • Q quiteSmart

          i checked that again now and it worked fine i don't know what is wrong with your code. What version of VS are you using mine is VS 2005 Look, just follow these steps: 1) create a new web application 2) go to the designer 3) add a button 4) double click the button 5) click on the project in the main menu. 6) add reference 7) in the .NET tab go to the System.Windows.Forms and click add 8) go to the source code of ur project. 9) add this name space using System.Windows.Forms 10) in the onClick event of the button write: MessageBox.Show("quiteSmart is very smart "); :) and it will work

          T Offline
          T Offline
          Tamimi Code
          wrote on last edited by
          #25

          man please stop kidding with me, that what i did exactly. i tried it on VS2005 and VS2003 and its working and it gives the same error. are you running under windows ??

          When you get mad...THINK twice that the only advice Tamimi - Code

          Q 1 Reply Last reply
          0
          • Q quiteSmart

            i checked that again now and it worked fine i don't know what is wrong with your code. What version of VS are you using mine is VS 2005 Look, just follow these steps: 1) create a new web application 2) go to the designer 3) add a button 4) double click the button 5) click on the project in the main menu. 6) add reference 7) in the .NET tab go to the System.Windows.Forms and click add 8) go to the source code of ur project. 9) add this name space using System.Windows.Forms 10) in the onClick event of the button write: MessageBox.Show("quiteSmart is very smart "); :) and it will work

            B Offline
            B Offline
            Bhupi Bhai
            wrote on last edited by
            #26

            VS2003 does not support this and I am sure VS2005 will also not !! Regards, Bhupi Bhai.

            Q 1 Reply Last reply
            0
            • T Tamimi Code

              man please stop kidding with me, that what i did exactly. i tried it on VS2005 and VS2003 and its working and it gives the same error. are you running under windows ??

              When you get mad...THINK twice that the only advice Tamimi - Code

              Q Offline
              Q Offline
              quiteSmart
              wrote on last edited by
              #27

              yea i am running under windows XP SP2 I told u what i know. Sorry if it is not working :doh:

              1 Reply Last reply
              0
              • B Bhupi Bhai

                VS2003 does not support this and I am sure VS2005 will also not !! Regards, Bhupi Bhai.

                Q Offline
                Q Offline
                quiteSmart
                wrote on last edited by
                #28

                me and many other's for example the first poster tried it and it works so don't be sure of something u didn't try:suss:

                T 1 Reply Last reply
                0
                • Q quiteSmart

                  me and many other's for example the first poster tried it and it works so don't be sure of something u didn't try:suss:

                  T Offline
                  T Offline
                  Tamimi Code
                  wrote on last edited by
                  #29

                  now we need a judge !!

                  When you get mad...THINK twice that the only advice Tamimi - Code

                  Q 1 Reply Last reply
                  0
                  • T Tamimi Code

                    now we need a judge !!

                    When you get mad...THINK twice that the only advice Tamimi - Code

                    Q Offline
                    Q Offline
                    quiteSmart
                    wrote on last edited by
                    #30

                    hahahahahaha Maybe we should bring one. Anyways maybe you will find one day that i am write and maybe i will find that i am wronge.

                    1 Reply Last reply
                    0
                    • Q quiteSmart

                      sorry man, i don't work much on ASP, my basic work is C# but i have passed through ASP for my own knowledge only. I am not sure about the answer i will give you but i think that what u said is logic and will work. Hope u get the best out of it. Note: for next time please post the ASP questions in the ASP MessageBoard Good Luck

                      M Offline
                      M Offline
                      mohd imran abdul aziz
                      wrote on last edited by
                      #31

                      Actuaaly in page load event other file , i just want to fetch the selected item menu in other page. that is i have form called home.aspx where i have defined menu.based on selected item menu. i will write code in(C#) other form master.aspx.cs So i want to fetch selected menu item in master.aspx.cs how i can do that that i want to know. thanks

                      regards imran khan

                      1 Reply Last reply
                      0
                      • J jdkulkarni

                        Exactly right. You can not pop up MessageBox.Show("") in ASP.NET. You will get 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.". You should only use Alert or Confirm. Especially in your case Confirm should work fine.

                        Jayant D. Kulkarni Brainbench Certified Software Engineer in C#, ASP.NET, .NET Framework and ADO.NET


                        E Offline
                        E Offline
                        Eric Dahlvang
                        wrote on last edited by
                        #32

                        I don't mean to step into the middle of your battle here, but if you read the error message carefully, you will see that it is POSSIBLE to use MessageBox.Show(). And, I did in fact try it. I got the error you mentioned, until I used the ServiceNotification style.

                        MessageBox.Show("message", "Caption", 0,0,0, MessageBoxOptions.ServiceNotification);

                        I hope this helps.

                        --EricDV Sig--------- Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them. - Laurence J. Peters

                        J 2 Replies Last reply
                        0
                        • E Eric Dahlvang

                          I don't mean to step into the middle of your battle here, but if you read the error message carefully, you will see that it is POSSIBLE to use MessageBox.Show(). And, I did in fact try it. I got the error you mentioned, until I used the ServiceNotification style.

                          MessageBox.Show("message", "Caption", 0,0,0, MessageBoxOptions.ServiceNotification);

                          I hope this helps.

                          --EricDV Sig--------- Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them. - Laurence J. Peters

                          J Offline
                          J Offline
                          jdkulkarni
                          wrote on last edited by
                          #33

                          Very strange to see that. But how does it work on client side is still a question. Or does it work only on localhost? I think it will work only on localhost. Have you tested this? Also you can see the same discussion at http://p2p.wrox.com/topic.asp?TOPIC_ID=11595[^] :)

                          Jayant D. Kulkarni Brainbench Certified Software Engineer in C#, ASP.NET, .NET Framework and ADO.NET

                          1 Reply Last reply
                          0
                          • E Eric Dahlvang

                            I don't mean to step into the middle of your battle here, but if you read the error message carefully, you will see that it is POSSIBLE to use MessageBox.Show(). And, I did in fact try it. I got the error you mentioned, until I used the ServiceNotification style.

                            MessageBox.Show("message", "Caption", 0,0,0, MessageBoxOptions.ServiceNotification);

                            I hope this helps.

                            --EricDV Sig--------- Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them. - Laurence J. Peters

                            J Offline
                            J Offline
                            jdkulkarni
                            wrote on last edited by
                            #34

                            Just checked it. MessageBox is always populated on server desktop. It will create hell when thousands of user will access the site and there is message box for frequently occuring errors or events. This is same like showing message box from a console application. I dont see any use unless and until somebody is continously sitting in front of server and tracking the errors. I found this link. http://www.developerfusion.co.uk/show/4700/[^] :)

                            Jayant D. Kulkarni Brainbench Certified Software Engineer in C#, ASP.NET, .NET Framework and ADO.NET

                            E 1 Reply Last reply
                            0
                            • J jdkulkarni

                              Just checked it. MessageBox is always populated on server desktop. It will create hell when thousands of user will access the site and there is message box for frequently occuring errors or events. This is same like showing message box from a console application. I dont see any use unless and until somebody is continously sitting in front of server and tracking the errors. I found this link. http://www.developerfusion.co.uk/show/4700/[^] :)

                              Jayant D. Kulkarni Brainbench Certified Software Engineer in C#, ASP.NET, .NET Framework and ADO.NET

                              E Offline
                              E Offline
                              Eric Dahlvang
                              wrote on last edited by
                              #35

                              jdkulkarni wrote:

                              I dont see any use unless and until somebody is continously sitting in front of server and tracking the errors.

                              I agree, it only seems useful for development purposes.

                              --EricDV Sig--------- Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them. - Laurence J. Peters

                              1 Reply Last reply
                              0
                              Reply
                              • Reply as topic
                              Log in to reply
                              • Oldest to Newest
                              • Newest to Oldest
                              • Most Votes


                              • Login

                              • Don't have an account? Register

                              • Login or register to search.
                              • First post
                                Last post
                              0
                              • Categories
                              • Recent
                              • Tags
                              • Popular
                              • World
                              • Users
                              • Groups