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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T17:15:19+00:00 2026-06-15T17:15:19+00:00

So im just using an ASP.NET atm Iv added 4 textboxes from the toolbox

  • 0

So im just using an ASP.NET atm

Iv added 4 textboxes from the toolbox TextBox1, TextBox2, TextBox3, TextBox 4 and a button ‘button1’

I want the user to enter data into the textboxs, compare them by .length and produce the output in order.

So before ordering them I am just trying to display them in the order of boxes textbox1, textbox2, textbox3.

protected void Button1_Click(object sender, EventArgs e)
    {
        DatesInOrderTextBox.Text = "Dates in order are" + TextBox1 + ", " + TextBox2 + ", " + TextBox3;

}

After that I intend to do something like the following

        //date 1 is biggest
        if (date1.Length > date2.Length && date1.Length > date3.Length)
        {
            //date 2 is 2nd & date 3 is 3rd
            if (date2.Length > date3.Length)
            {
                FirstDateOrder = date1;
                SecondDateOrder = date2;
                ThirdDateOrder = date3;

              System.Windows.Forms.MessageBox.Show("Order is 1, 2, 3");

             //   System.Windows.Forms.MessageBox.Show("Order is:" + FirstDateOrder + ", " + SecondDateOrder + ", " + ThirdDateOrder);

                ViewBag.DateOrder = "Order is 1,2,3";

                return RedirectToAction("Index");
            }

            //date 3 is 2nd & date 2 is 3rd
            else
            {
                FirstDateOrder = date1;
                SecondDateOrder = date3;
                ThirdDateOrder = date2;

                System.Windows.Forms.MessageBox.Show("Order is 1, 3, 2");

                return RedirectToAction("Index");
            }

}

Although when I click the button textbox4 is displaying

Dates in order areSystem.Web.UI.WebControls.TextBox, System.Web.UI.WebControls.TextBox, System.Web.UI.WebControls.TextBox

prob something simple just dont know how to fix it…thank you guys

  • 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-15T17:15:21+00:00Added an answer on June 15, 2026 at 5:15 pm

    You are missing a .Text when showing the textbox value. Should be TextBox1.Text…

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

Sidebar

Related Questions

I have been using asp.net programming just from few months and I have to
Let me first put the code snippets here. I am just using the ASP.NET
I'm using ASP.NET MVC 3, and just ran into a 'gotcha' using the DropDownListFor
I've just recently started to build a web site using ASP.NET - MVC 4,
I am just getting into more client-side stuff in ASP.NET using Javascript, and there's
Just starting to learn ASP.NET (C#) and I am using Visual Studio 2008. I
I just found out about superfish and currently using it on an asp.net. The
I'm just getting started with ASP.NET MVC. I'm going to be using JQuery on
So i just started using ASP.NET MVC and i'm really liking it, except i
I’ve only just started using ASP.NET MVC, and I have a somewhat trivial question:

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.