Find a HTML control using FindControl in ASP.NET
<p>I add a select control to a ASPX page like below:</p>

<pre><code>hgc = new HtmlGenericControl();
hgc.InnerHtml = @"&lt;select runat='server' id='my_selectlist'&gt; \
                  &lt;option value='volvo'&gt;Volvo&lt;/option&gt; \
                  &lt;option value='saab'&gt;Saab&lt;/option&gt; \
                  &lt;option value='mercedes'&gt;Mercedes&lt;/option&gt; \
                  &lt;option value='audi'&gt;Audi&lt;/option&gt; \
                &lt;/select&gt;";
</code></pre>

<p>Then in a Button click event, I use the code below, try to get the value selected</p>

<pre><code>HtmlSelect s = (HtmlSelect)hgc.FindControl("my_selectlist");
label.Text = s.Value;
</code></pre>

<p>I get a error:"<strong>Object reference not set to an instance of an object.</strong>"
Does anyone try it before?</p>

<p>Best Regards</p>
