Controls = NOTHING on Page_Load, cannot set control properties
Posted on 2004-10-26
I have a web form in a project that has suddenly become a problem.
I removed a checkbox that was working on the form, and added two radio buttons instead.
In the form's Page_Load routine, I read a DataRow item's value - and check the appropriate radio button.
The problem is - I get "...NullReferenceException - Object not set to an instance of an object." on the line setting the Checked property.
If I break on that line, my radio button is indeed Nothing. I next put a new label on the page, and set it's text in the form's Page_Load routine - SAME PROBLEM - NullReferenceException - Object not set to an instance of an object."
In both cases, the region "Web Form Designer Generated Code" DOES contain the lines Protected WithEvents... declaring the new controls.
Any ideas what could this problem be caused by???? How can I resolve it???? Thanks in advance!