471,089 Members | 1,320 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,089 software developers and data experts.

Why I get error "There was an error rendering..."

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

Jan 26 '06 #1
1 1739
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

Jan 26 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.