i've searched looking for an answer... i've tried everything and yet Me.DesignMode does not do what it's suppose to do.
this is the code i have in a usercontrol in the constructor
vb Code:
If Not Me.DesignMode Then
DataImport = New Importer 'Error still occurs
End If
i've tried this
vb Code:
If Not Me.Site.DesignMode Then
DataImport = New Importer 'error still occurs
End If
however as soon as i comment out the initialization of the DataImport everything is freaking happy...
now for the wonderful twist... which makes no sense...
if i do this
vb Code:
If Me.DesignMode Then
DataImport = New Importer 'doesn't get initialized
End If
and clean and rebuild the solution the control load with no problem.... however at runtime when i try and call a method in the Importer class it obviously fails because it's not initialized. i'm soon just going to place my initialization in the load event which is not were i really want it, but at least it will work. so i'm hoping someone can shed some light on this.
this is seriously stressing me out