MessageBox using Dllimport

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • raghulvarma
    New Member
    • Oct 2007
    • 90

    MessageBox using Dllimport

    To display a messagebox i used the below shown code
    [DllImport("user 32.dll",Entrypo int="Messagebox ")]
    public static extern int MessageBox(int hwnd,string message,string caption,uint uitype)

    then when I use the above mentioned messagebox in order to get the exception from the sql statements it shows a error message that overloading is not possible what has to be done to it?
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    Why wouldn't you just use the regular .NET MessageBox ? It's probably erroring because you already have access to the MessageBox object.

    Comment

    • raghulvarma
      New Member
      • Oct 2007
      • 90

      #3
      Originally posted by Plater
      Why wouldn't you just use the regular .NET MessageBox ? It's probably erroring because you already have access to the MessageBox object.
      But in ASP applications u doent have default messagebox either u could add reference and get the controls by adding the namespace
      using System.windows. forms and get the messagebox from that or either get the messagebox through a script ('Alert') or as i mentioned above.

      Waiting for ur reply

      Regards
      raghul

      Comment

      • Curtis Rutland
        Recognized Expert Specialist
        • Apr 2008
        • 3264

        #4
        Originally posted by raghulvarma
        But in ASP applications u doent have default messagebox either u could add reference and get the controls by adding the namespace
        using System.windows. forms and get the messagebox from that or either get the messagebox through a script ('Alert') or as i mentioned above.

        Waiting for ur reply

        Regards
        raghul
        AFAIK you can't use a Windows Forms message box in ASP.NET. At all. And if you could, it would pop up on the server, not the client.

        Comment

        • Plater
          Recognized Expert Expert
          • Apr 2007
          • 7872

          #5
          Originally posted by insertAlias
          AFAIK you can't use a Windows Forms message box in ASP.NET. At all. And if you could, it would pop up on the server, not the client.
          Exatly. Alias you keep beating me to the punch


          You should be looking at various aspnet messagebox options.

          Comment

          Working...