how to popup message box on the client side-VBForums
Results 1 to 6 of 6

Thread: how to popup message box on the client side

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 2010
    Posts
    2

    how to popup message box on the client side

    Hi all,
    I am coding with VB.Net 2005.
    I have an issue popping up a message box on the client's side.
    The message box works well when running the application on my
    local machine, but when the site is hosted on the server, there is an
    error showing a conventional message box() in vb.net 2005 on the
    client's machine.
    can anyone please help me with the script to pop up a message box
    on the client's side when the site is hosted.
    Thanks

  2. #2
    ASP.NET Moderator gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,961

    Re: how to popup message box on the client side

    Hello,

    And welcome to the forums!!

    The problem here is the fact that you are using MessageBox.Show(). This class exists within the System.Windows.Forms namespace, and as such, has no place in a Web Application. It "works" on your local machine because while debugging out of Visual Studio your machine is both the server, and the client. As soon as you move it onto another machine, i.e. a server, it will stop working.

    There are techniques that you can use, such as a JavaScript alert, which would allow you to pop up a message, or you could simply write the message out to a label on your page.

    Gary

  3. #3
    Hyperactive Member dnanetwork's Avatar
    Join Date
    Oct 2007
    Location
    Mumbai
    Posts
    348

    Re: how to popup message box on the client side

    you can use Jquery modal Popup.

  4. #4
    ASP.NET Moderator gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,961

    Re: how to popup message box on the client side

    Quote Originally Posted by dnanetwork View Post
    you can use Jquery modal Popup.
    This is what Dana is referring to:

    http://plugins.jquery.com/plugin-tags/modal-popup

    Gary

  5. #5

    Thread Starter
    New Member
    Join Date
    Dec 2010
    Posts
    2

    Re: how to popup message box on the client side

    Thanks Gary n Dana,
    Don't understand how to use the jquery in my vb.net code, please
    can i get i tip on this? alternatively is there a java script code i can use
    in my code?

  6. #6
    ASP.NET Moderator gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,961

    Re: how to popup message box on the client side

    As I already mentioned you could get a simple JavaScript alert box:

    http://www.tizag.com/javascriptT/javascriptalert.php

    As for getting jQuery working within your application, have a look here:

    http://www.dotnetcurry.com/ShowArticle.aspx?ID=231

    Gary

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.