所以我只是使用 ASP.NET atm
Iv 从工具箱 TextBox1、TextBox2、TextBox3、TextBox 4 和一个按钮“button1”中添加了 4 个文本框
我希望用户在文本框中输入数据,按 .length 比较它们并按顺序生成输出。
所以在订购它们之前,我只是想按文本框 1、文本框 2、文本框 3 的顺序显示它们。
protected void Button1_Click(object sender, EventArgs e)
{
DatesInOrderTextBox.Text = "Dates in order are" + TextBox1 + ", " + TextBox2 + ", " + TextBox3;
}
之后我打算做类似以下的事情
//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");
}
}
虽然当我单击按钮时 textbox4 正在显示
Dates in order areSystem.Web.UI.WebControls.TextBox, System.Web.UI.WebControls.TextBox, System.Web.UI.WebControls.TextBox
可能是一些简单的事情,只是不知道如何解决它......谢谢你们