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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T19:22:10+00:00 2026-05-27T19:22:10+00:00

This is very very strange. Basically, i’m using ASP.NET. What I want is to

  • 0

This is very very strange.

Basically, i’m using ASP.NET. What I want is to get the .Text value from a label.

Initially, the label is actually totally empty. However, after some interaction and some clicks etc, the label changes.

Now…. I want to simply access the content of that specific label…BUT….ASP.NET thinks it’s content is STILL empty.

As a test, I changed the content of the label in to something obvious like “lol”, for example.

Then I did the procedure again. Now….This time, the results for checking the contents after all of the interaction and clicks etc turned out to be “lol”…

This means that ASP isn’t keeping track of current changes. It just keeps in mind what the initial values were.

The reason why I am checking the contents is because I wish to send an email. Below is my code:

  MailMessage email = new MailMessage();
    email.Subject = "****";
    email.To.Add(txtEmailTo.Text);
    email.From = new MailAddress("****");
    email.IsBodyHtml = true;
    string emailBody = "<h2>Journey Details</h2><br><strong>From</strong>: %From%<br><strong>To</strong>: %To%<br><strong>Price</strong>: %Price%<br><hr><br>Kind Regards, <br><br>";
    String newBody = emailBody;
    newBody.Replace("%From%", lblResultsFrom.Text);
    email.Body = newBody;

    try
    {
        SMTPServer.Send(email);
    }

    catch (Exception ex)
    {
        lblError.Text = ex.ToString();
    }
  • 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-27T19:22:11+00:00Added an answer on May 27, 2026 at 7:22 pm

    I managed to fix my code. The following works:

    var SMTPServer = new SmtpClient
            {
                Host = "smtp.gmail.com",
                Port = 587,
                EnableSsl = true,
                DeliveryMethod = SmtpDeliveryMethod.Network,
                UseDefaultCredentials = false,
                Credentials = new System.Net.NetworkCredential("..", "..."),
            };
    
            MailMessage email = new MailMessage();
            email.Subject = "...";
            email.To.Add(txtEmailTo.Text);
            email.From = new MailAddress("..");
            email.IsBodyHtml = true;
            string emailBody = "...";
            String newBody = emailBody;
            email.Body = newBody;
    
            try
            {
                SMTPServer.Send(email);
            }
    
            catch (Exception ex)
            {
                lblError.Text = ex.ToString();
            }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Starting from Android 3.2 I have this strange problem. It's very easy to reproduce:
I've got this to work using a very basic example(outlined below) and I want
This very strange. When I resize a WinForms dialog the controls are flickering very
This is very strange, but when I add the mysql_real_escape_string it doesn't load the
This problem is very strange and I'm hoping someone can help me. For the
This is a very strange problem, and I just hope that I can clearly
It was very strange when I saw this on debugging my application. int iTag
it is very strange, because this error doesn't happen all the time... I have
I am getting a very strange error in my code. This assignment is for
This very simple code: #include <iostream> using namespace std; void exec(char* option) { cout

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.