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 8215549
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T11:49:40+00:00 2026-06-07T11:49:40+00:00

I keep getting the following error message at compile time: The name ‘Message’ does

  • 0

I keep getting the following error message at compile time: “The name ‘Message’ does not exist in the current context”. All I’m trying to do is pop up a message box. Here are my namespaces declared at the top of my code behind page:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Net.Mail;

And here is my code to show a message on a button click:

    protected void EmailAbout_Click(object sender, EventArgs e)
    {
        MailMessage myMessage = new MailMessage();
        myMessage.Subject = "Exception Handling Test";
        myMessage.Body = "Test message body";
        myMessage.From = new MailAddress("me@yourprovider.com");
        myMessage.To.Add(new MailAddress("you@yourprovider.com"));

        SmtpClient mySmtpClient = new SmtpClient();
        mySmtpClient.Send(myMessage);
        Message.Text = "Message sent";
    }

Is this a case of a missing namespace? It seems so basic yet I can’t figure it out? Thanks in advance!

Here is the markup page:

<%@ Page Title="About SalesPro" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
CodeBehind="About.aspx.cs" Inherits="WebApplication2.About" %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>

<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <h2>
        About, Inc.
    </h2>

    <p>
        Some Stuff here... 
    </p>

    <p>
        <asp:Button ID="EmailAbout" runat="server" Text="Email Information" 
            onclick="EmailAbout_Click" />
    </p>
</asp:Content>
  • 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-06-07T11:49:42+00:00Added an answer on June 7, 2026 at 11:49 am

    You need the javaScript-function “alert()” 🙂

    Try this:

    RegisterStartupScript("alertBox1", "<script type='text/javascript'>alert('Message sent');</script>");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I keep getting the following error message ERROR 1064 (42000): You have an error
With the following code, I keep getting error C2535 when I compile. It's complaining
What is wrong with the statement below? I keep getting the following error message....
Following the RailsTutorial, I keep getting this error message (one of four actually) when
Following the RailsTutorial, I keep getting this error message (one of four actually) when
I keep getting the following error message when I run my code in debug.
I keep getting the following error message when trying to UPDATE one of my
I keep getting the following error when debugging. Cross-thread operation not valid: Control 'richTextBoxReceivedMsg'
I keep getting the following error: Parse error: syntax error, unexpected T_SL in /home/a4999406/public_html/willingLog.html
I keep getting the following error: AttributeError: Caribou instance has no attribute 'on_key_up' The

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.