First Item in dropdownlist doesn't fire SelectedIndexChanged at all

后端 未结 7 2170
盖世英雄少女心
盖世英雄少女心 2021-02-20 12:24

I have following simple code:

<%@ Page Language=\"C#\" AutoEventWireup=\"true\" CodeBehind=\"testForm.aspx.cs\" Inherits=\"Orbs.testForm\" %>

         


        
7条回答
  •  盖世英雄少女心
    2021-02-20 12:52

    In my case, this happened because I had referred to that dropdown using a local dropdownlist variable, and disposed off that variable at the end of a function. I was adding the first item to the dropdownlist after setting a datasource. Took me 2 hours to find this, and worked perfectly after I removed the dispose call.

提交回复
热议问题