คำถามติดแท็ก selectedindexchanged

7
เหตุการณ์ SelectedIndexChanged ของ DropDownList ไม่ได้เริ่มทำงาน
ฉันมีวัตถุ DropDownList ในหน้าเว็บของฉัน เมื่อฉันคลิกที่มันและเลือกค่าที่แตกต่างกันไม่มีอะไรเกิดขึ้นแม้ว่าฉันจะมีฟังก์ชั่นต่อสายเข้ากับSelectedIndexChangedเหตุการณ์ ก่อนรหัส HTML ของวัตถุจริง: <asp:DropDownList ID="logList" runat="server" onselectedindexchanged="itemSelected"> </asp:DropDownList> และนี่คือฟังก์ชันนั้นitemSelected: protected void itemSelected(object sender, EventArgs e) { Response.Write("Getting clicked; " + sender.GetType().ToString()); FileInfo selectedfile; Response.Write("<script>alert('Hello')</script>"); foreach (FileInfo file in logs) { if (file.Name == logList.Items[logList.SelectedIndex].Text) { Response.Write("<script>alert('Hello')</script>"); } } } ไม่มีการตอบกลับปรากฏขึ้นและไม่มีการเรียกใช้ส่วนของ JavaScript ฉันได้ลองใช้ Firefox เวอร์ชันล่าสุด 3.6 แล้วเช่นเดียวกับ …
โดยการใช้ไซต์ของเรา หมายความว่าคุณได้อ่านและทำความเข้าใจนโยบายคุกกี้และนโยบายความเป็นส่วนตัวของเราแล้ว
Licensed under cc by-sa 3.0 with attribution required.