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.
After that I intend to do something like the following
Although when I click the button textbox4 is displaying
prob something simple just dont know how to fix it...thank you guys
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