[請益] 請問ASP.NET Autopost的問題

看板C_Sharp (C#)作者 (ptt訪客)時間19年前 (2006/08/29 11:51), 編輯推噓1(100)
留言1則, 1人參與, 最新討論串1/1
我將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

08/30 01:31, , 1F
應該是不會,你用debug一行一行跑試看看,語法準確性要高
08/30 01:31, 1F
文章代碼(AID): #14yxcysG (C_Sharp)
文章代碼(AID): #14yxcysG (C_Sharp)