試圖得到它,所以如果你離開點擊,它會填寫4個文本框,然後如果你使用下拉列表並再次點擊它,它會填充在4個不同的文本框中 - 必須一次填充20個,4個。C#for循環on button1_click1,int我似乎前進錯了
int carpick, qty, total, i;
protected void Button1_Click1(object sender, EventArgs e)
{
for (i = 0; i != 5; ++i)
{
carpick = 0; qty = 0; total = 0;
{
carpick = Convert.ToInt32(CarpickDD.SelectedItem.Value);
qty = Convert.ToInt32(QTYDD.SelectedItem.Value);
total = ((carpick * qty) + (750 * qty));
Label1.Text = CarpickDD.SelectedItem.Text;
Label2.Text = CarpickDD.SelectedItem.Value;
Label3.Text = QTYDD.SelectedItem.Value;
Label4.Text = Convert.ToString(total);}
if (i != 1)
{
carpick = Convert.ToInt32(CarpickDD.SelectedItem.Value);
qty = Convert.ToInt32(QTYDD.SelectedItem.Value);
total = ((carpick * qty) + (750 * qty));
Label5.Text = CarpickDD.SelectedItem.Text;
Label6.Text = CarpickDD.SelectedItem.Value;
Label7.Text = QTYDD.SelectedItem.Value;
Label8.Text = Convert.ToString(total);
}
}
}
enter code here
好吧,我明白你說的話 - 但有沒有辦法讓它前進?我真的很陌生,並且知道的不多 – estoy0no 2010-09-20 04:45:57