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

  • Home
  • SEARCH
  • 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 968567
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T02:30:12+00:00 2026-05-16T02:30:12+00:00

Using C# How to display a message box in C# I cannot find the

  • 0

Using C#

How to display a message box in C#

I cannot find the message box in the dropdownlist….

How to display a message box in webpages…

  • 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-16T02:30:13+00:00Added an answer on May 16, 2026 at 2:30 am

    Simply put there is no MessageBox Class in ASP.NET. Since ASP.NET executes on the server it would display on the server and not the clients machine (if there were one). Your best bet would be to use JavaScript or write your own.

    Here’s an example of creating your own MessageBox class for ASP.NET

    public static class MessageBox
    {
        //StringBuilder to hold our client-side script
        private static StringBuilder builder;
    
        public static void Show(string message)
        {
            //initialize our StringBuilder
            builder = new StringBuilder();
    
            //format script by replacing characters with JavaScript compliant characters
            message = message.Replace("\n", "\\n");
            message = message.Replace("\"", "'");
    
            //create our client-side script
            builder.Append("<script language=\"");
            builder.Append("javascript\"");
            builder.Append("type=\"text/javascript\">");
            builder.AppendFormat("\t\t");
            builder.Append("alert( \"" + message + "\" );");
            builder.Append(@"</script>");
    
            //retrieve calling page
            Page page = HttpContext.Current.Handler as Page;
    
            //add client-side script to end of current response
            page.Unload += new EventHandler(page_Unload);
        }
    
        private static void page_Unload(object sender, EventArgs e)
        {
            //write our script to the page at the end of the current response
            HttpContext.Current.Response.Write(builder);
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using the message-box fn, I can display a modal dialog. I know this is
Can a windows message box be display using the cout syntax? I also need
I'm trying to display a Message Box with both an icon and buttons using
When I display message box using msgbox (Show my message) in asp.net webforms, it
I am using jqgrid and I like to display custom message while deleting a
I want to display the message Hi how are you? for 1 minute using
I've got this code from Mads Kristensen's blog to display a message box on
I have using android alert dialog builder to display the some user message(String) as
Im using System.Windows.MessageBox.Show() to display a dialog to the user. One overload lets me
I'm using jGrowl to display messages and alerts, the datepicker I'm using is triggering

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.