I will tell you how I encountered it. I created a user control that has a property. In a page form I included this user control among others. In control's Load event I had to use that defined property. And I did not understood why it needs to know the value in design time, however it shows this nice error. It is obvious that is not set. It is only set when running.
So. Ready with long talk. The only think you need to get away of this "Object reference not set to an instance of an object" error you must use DesignMode property of the control. :)
if (!this.DesignMode) { //your code here that generates the error }Well, hope that I helped you today with this error. Keep up the good code ;)
No comments:
Post a Comment