.net - System.ArgumentNullException when adding AutoPostback to DropdownList -
When I add autopostback = trust with my dropdown list (on-selected index change), I get a system . Exceptional exception: Value can not be empty.
My control looks like this:
& lt; ASP: Dropdown list id = "dropdown" runat = "server" autostebback = "true" by changing the on-selected index = "dropdown_on-selected index changelog" />
and the code to fill the control:
dropdown. Items.ad (new list item ("item 1", "1")); drop down. ITEM Add (new list item ("item 2", "2")); drop down. ITEM Add (new list item ("item 3", "3"));
update
I get an error when I add an empty page with the following code:
& Lt ;; DOCTYPE HTML PUBLIC "- // W3C // DTT XHTML 1.0 Transcription // N" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> & Lt; Html xmlns = "http://www.w3.org/1999/xhtml" & gt; & Lt; Head runat = "server" & gt; & Lt; Title & gt; & Lt; / Title & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; Form id = "form1" runat = "server" & gt; & Lt; Div & gt; & Lt; ASP: Dropdownlight Autopost = "True" ID = "Dropdown List 1" Runat = "Server" /> & Lt; / Div & gt; & Lt; / Form & gt; & Lt; / Body & gt; & Lt; / Html & gt;
The problem is solved. One component which I was using inside my web.config was causing the problem. So I have another web in a similar category. Added config to the page and used the faulty component and the problem was solved. (Unless I use autopost on that page;))
Comments
Post a Comment