ASP.Net Dropdown List is not throwing an error
<p>I am having problems with dropdown lists NOT throwing an error with the following code in ASP.Net 4.0</p>

<p>the dropdown list is empty to start. The page in question is a simple test page containing no code besides the lines below in Page_Load.</p>

<pre><code>ddlTest.Items.Add(new ListItem("test","test"));
ddlTest.SelectedValue = "Fail";
</code></pre>

<p>When I load the page, the DDL displays "test" as the only item (as expected) and no error is thrown. I thought an error would be thrown with something like "item 'Fail' does not exist"</p>

<p>I have tested the code both, inside an if (!IsPostBack) block and outside of it. The results are the same.</p>

<p>Does this make sense? I don't understand why this is not throwing an error. Any explanation would be greatly appreciated.</p>

<p>Thanks.</p>
