Find Control returning null

285 Views Asked by At

When I try to find a control on the current page, it returns null every time and the control is right there.

HTML:

<input type="radio" id="test2" value="Hello World" name="Test"/>

Code Behind

HtmlInputRadioButton control = (HtmlInputRadioButton)Page.FindControl("test2");
            Response.Write(control.Value);
            Response.Write(control.ID);

Any idea why it keeps returning null??

enter image description here

0

There are 0 best solutions below