problem with messagebox class

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jany
    New Member
    • Sep 2007
    • 10

    problem with messagebox class

    iam new to dotnet ,iam not getting messagebox class in my system.(present ly iam working with c#).please help me how to get it ...
    thanks in advance..
  • RoninZA
    New Member
    • Jul 2007
    • 78

    #2
    You need to use the System.Windows. Forms.MessageBo x class... this obviously needs to be a windows application for you to be able to use it, because the MessageBox class needs a Windows interface to run on. MessageBoxes can not be displayed from a console application (as far as I know) or a web page, for example.

    Comment

    • aliasruel
      New Member
      • Sep 2007
      • 73

      #3
      Hi jany]iam ,

      There is none.. But you can always create a messagebox functionality program code in c#.net .

      Best Regards,
      Ruel




      Originally posted by jany
      iam new to dotnet ,iam not getting messagebox class in my system.(present ly iam working with c#).please help me how to get it ...
      thanks in advance..

      Comment

      • mzmishra
        Recognized Expert Contributor
        • Aug 2007
        • 390

        #4
        You can create messagebox using javascript in your code.

        Comment

        • SammyB
          Recognized Expert Contributor
          • Mar 2007
          • 807

          #5
          Originally posted by jany
          iam new to dotnet ,iam not getting messagebox class in my system.(present ly iam working with c#).please help me how to get it ...
          thanks in advance..
          Here is a sample class that uses a message box. Note at the top that I have
          using System.Windows. Forms;
          Code:
          using System;
          using System.Windows.Forms;
          namespace WindowsApplication1
          {
          	class Sample
          	{
          		private DateTime StartTime;
          		public Sample(DateTime dtStart)
          		{
          			if (dtStart > DateTime.Now)
          				MessageBox.Show("Invalid Time");
          			else
          				StartTime = dtStart;
          		}
          	}
          }

          Comment

          • jany
            New Member
            • Sep 2007
            • 10

            #6
            Originally posted by SammyB
            Here is a sample class that uses a message box. Note at the top that I have
            using System.Windows. Forms;
            Code:
            using System;
            using System.Windows.Forms;
            namespace WindowsApplication1
            {
            	class Sample
            	{
            		private DateTime StartTime;
            		public Sample(DateTime dtStart)
            		{
            			if (dtStart > DateTime.Now)
            				MessageBox.Show("Invalid Time");
            			else
            				StartTime = dtStart;
            		}
            	}
            }


            hi sammy, thanks for your response..
            i know that message box class is available in windows app.but iam using a web application (C#),is there any chane to use message box class...
            iam getting only "mbox" throrgh intellisence..b ut it is also not working properly...

            Comment

            • jany
              New Member
              • Sep 2007
              • 10

              #7
              Originally posted by aliasruel
              Hi jany]iam ,

              There is none.. But you can always create a messagebox functionality program code in c#.net .

              Best Regards,
              Ruel
              hi aliasruel,
              thanks for your reply
              iam using c# olny,but is a web application,
              then how to display the message box....

              Comment

              • dip_developer
                Recognized Expert Contributor
                • Aug 2006
                • 648

                #8
                Originally posted by jany
                hi aliasruel,
                thanks for your reply
                iam using c# olny,but is a web application,
                then how to display the message box....
                you can use Javascript for message boxes......

                you can use the alert() function....... ..

                or you can use a new webpage as a messagebox..... .try to use javascript window.open() function.... in any button_click event you can have a pop-up window with the following code
                [CODE=css]

                string popupScript = "<script language='javas cript'>" +
                "window.open('A ddNewProduct.as px', 'CustomPopUp', " +
                "'width=850 , height=650, menubar=no, resizable=no')" +
                "</script>";
                Page.RegisterSt artupScript("Po pupScript", popupScript);
                [/CODE]

                Comment

                • Plater
                  Recognized Expert Expert
                  • Apr 2007
                  • 7872

                  #9
                  Originally posted by jany
                  but iam using a web application (C#)
                  This is why we have a posting guideline that specifically asks you to include that kind of information in your original post.
                  It would save us all time (except for me because I'm dumb and skim over it sometimes causing lots of confusion)

                  Comment

                  • aliasruel
                    New Member
                    • Sep 2007
                    • 73

                    #10
                    Hi Jany,

                    You dont need to create a new webpage as a messagebox. In c#.net i have created a functionality in web application that will perform the same behavior of a message box just like in windows form.
                    maybe you can email me to [snip] then i will send the tool to you.

                    Best Regards,
                    Ruel




                    Originally posted by jany
                    hi aliasruel,
                    thanks for your reply
                    iam using c# olny,but is a web application,
                    then how to display the message box....
                    Last edited by prometheuzz; Sep 13 '07, 08:17 AM. Reason: Please do not post e-mail addresses: use the forum to communicate.

                    Comment

                    Working...