Mahesh
Mahesh

Reputation: 1784

Gmail like alert box (for infomation or error display) throught jQuery in ASP.NET

I am looking for some sample code/control which gives me the feel of gmail like message box through jQuery in ASP.NET.

Upvotes: 5

Views: 21278

Answers (2)

Pawel Krakowiak
Pawel Krakowiak

Reputation: 10100

You can use plugins, but you can also have a fixed DIV sitting at the top of your page and fade it in/out. Let's see an example:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>jQuery</title>
        <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script>
        <script type="text/javascript">
            $(document).ready(function() {
                $('input').click(function() {
                    $('#notification').fadeIn('slow');
                });
            });
        </script>
    </head>
    <body style="height: 1000px;">
        <div id="notification" style="position: fixed; top: 0px; margin-left: 50%; background-color: yellow; font-weight: bold; display: none;">Sending...</div>
        <input type="button" value="Gmail notification!" />
    </body>
</html>

You have to work out how to hide it (a callback after the operation completes, etc.), style it and so on. That's just an example.

Upvotes: 5

Davy Landman
Davy Landman

Reputation: 15438

I think what your looking for is jQuery BlockUI.

Have a look at the demo's.

Using css you can match the styles of gmail.

Upvotes: 13

Related Questions