Without seeing what you're overriding, I can only take a guess.
The designer does load the control so you will go through several of the
normal 'rendering' events (e.g. Load, CreateChildControls, etc.). I'm
guessing you are changing the Text property to a value of an object that you
only have at runtime. You should wrap that call with a If..Then checking the
design mode something like below:
If Me.Site Is Nothing OrElse Not Me.Site.DesignMode Then
'TODO: Set the text to whatever object you're already setting it to
'Me.Text = <whatever it is that you're doing>
End If
HTH,
Matt Dinovo
"Jarod" <bl*****@NOSPAM.gazeta.pl> wrote in message
news:Ot*************@tk2msftngp13.phx.gbl...
Hey
When I put my control into DetailsView in a template I see it and it seems
as working ok. After compile it works on the page. But in normal view in
designer I don't see my detailsView instead of it I see "There was error
rendering the control. Object not set to an instance of object".
My control is derived from linkButton and I just needed to add a few
properties but rendering stays the same. For real I just override click
event and set something to Text property. And if I put this control on a
page it works. It doesn't render in designer view of detailsView only :(
Can you help ?
Jarod