A webpage was working well on the development machine but when I moved it to the server the document.getElementById returned null. Here an example: <script> alert(document.getElementById(“test”)); </script> <body> <input name=”test” type=”text” value=”testing..”> </body> The above alert should show the message “[object]” but it returns null. After few hours of troubleshooting it turned out that the
Receiving this error when trying to select an item in an ASP.NET dropdownlist as below: Dropdownlist1.items.FindByValue(“1”).Selected = True To Solve this, just call the ClearSelected method before selecting the item: Dropdownlist1.ClearSelection() Dropdownlist1.items.FindByValue(“1”).Selected = True