Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3851028
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T17:05:59+00:00 2026-05-19T17:05:59+00:00

I am new to Jquery and trying to start learning the new tool. What

  • 0

I am new to Jquery and trying to start learning the new tool. What I want to do is call a JQuery message box from my gridViews Row Command function after the processing is done so I can notify the user the process has been complete. I was trying to use this website as a referance
http://stuntsnippets.com/jquery-message-box/

But not sure how to call the function from the serverside. I have tried ClientScript.RegisterStartupScript
Thank you,
Spafa9

Place this inside your script tags…

$(document).ready(function () {
    //Determining if there is  a message to be shown if the message is not equal to empty string then the messagebox should appear.
    if(message != '') {
        message_box.show_message('Equipment Request:', message);
    }              
});

//JQuery to set up the messagebox.
var message_box = function () {
    var button = '<input type="button" onclick="message_box.close_message();" value="Ok" />';
    return {
        show_message: function (title, body) {
            if (jQuery('#message_box').html() === null) {
                var message = '<div id="message_box"><h1>' + title + '</h1>' + body + '<br/>' + button + '</div>';
                jQuery(document.body).append(message);
                jQuery(document.body).append('<div id="darkbg"></div>');
                jQuery('#darkbg').show();
                jQuery('#darkbg').css('height', jQuery('html, body').height());

                jQuery('#message_box').css('top', jQuery('html, body').scrollTop() + 150);
                jQuery('#message_box').show('slow');
            } else {
                var message = '<h1>' + title + '</h1>' + body + '<br/>' + button;
                jQuery('#darkbg').show();
                jQuery('#darkbg').css('height', jQuery('html, body').height());

                jQuery('#message_box').css('top', jQuery('html, body').scrollTop() + 150);
                jQuery('#message_box').show('slow');
                jQuery('#message_box').html(message);
            }
        },
        close_message: function () {
            jQuery('#message_box').hide('fast');
            jQuery('#darkbg').hide();
        }
    }
} ();

this goes in the CSS:

#darkbg {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;

    opacity: .5;
    filter: alpha(opacity=50);
    -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
}
#message_box {
    width: 300px;
    height: 150px;
    background: #fff;

    border: 4px solid #f0f0f0;
    border-radius: 10px;
    -moz-border-radius: 10px;
    -webkit-border-radius: 10px;

    position: absolute;
    top: 100px;
    left: 50%;
    margin-left: -150px;

    text-align: center;
    z-index: 1000;
    display: none;
}
#message_box input[type=button] {
    float:left;
    margin-left: 145px;
}

In the if not is postback of the page you are using the message box on put this line of code:

ltlMessage.Text = "<script type=""text/javascript"">var message = """"; </script>"

Then in you row command under the function in which you would like to show the message box place this code.

ltlMessage.Text = "<script type=""text/javascript"">var message = ""Email has been sent.""; </script>"
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T17:06:00+00:00Added an answer on May 19, 2026 at 5:06 pm

    I have modifed my post to include the working example. Hope this helps someone else out. One thing I forgot to note is on the page in which you would like the message box you will need a literal control to save off the message in my case it is called ltlmessage.
    Spafa9

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been trying to use the new jquery-ui, and all but the resizable function
I am new to jQuery and am trying to fire a function on a
I'm new to jQuery and trying to combine the use of a tooltip plugin
I'm new to jQuery and trying to change an attribute of an SVG element
I am new to Jquery and am trying to store the location and size
I fairly new to JQuery and perhaps trying to achieve something that might be
I'm rather new to jQuery and I'm trying to make a cool little menu
I'm fairly new to JQuery and I'm trying to add multiple form fields for
Very new to JQuery and MVC and webdevelopment over all. I'm now trying to
I'm new to jQuery, and I'm trying to cause another identical dropdown menu to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.