看板 C_Sharp 關於我們 聯絡資訊
我將checkboxlist、radiobuttonlist、dropdownlist、listbox使用AutopostBack屬性, 變換選取項目後將文字顯現在literal上,但dropdownlist跟listbox沒有將文字顯示在 literal上,但若將該兩項用button點選便有顯示在literal上,想請教大大這是什麼緣故 我是用Visual studio 2005編譯的 protected void CheckBoxList1_SelectedIndexChanged(object sender, EventArgs e) { this.Literal1.Text = this.CheckBoxList1.Text; }→literal有顯示出來 protected void RadioButtonList1_SelectedIndexChanged(object sender, EventArgs e) { this.Literal1.Text = this.RadioButtonList1.Text; }→literal有顯示出來 protected void Button1_Click(object sender, EventArgs e) { this.Literal1.Text = this.DropDownList1.SelectedValue; }→literal有顯示出來 protected void Button2_Click(object sender, EventArgs e) { this.Literal1.Text = this.ListBox1.Text; }→literal有顯示出來 protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) { this.Literal1.Text = this.DropDownList1.Text; }→literal無顯示 protected void ListBox1_SelectedIndexChanged(object sender, EventArgs e) { this.Literal1.Text = this.ListBox1.SelectedValue; }→literal無顯示 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 61.223.243.227
tomex:應該是不會,你用debug一行一行跑試看看,語法準確性要高 08/30 01:31