views:

334

answers:

1

I have a custom control that inherits from Repeater. I need to inject some markup around the items within the repeater. Currently im looping around Repeater.Items (OnPreRender) and adding LiteralControls containing the markup. This works great except for when performing a postback, as it throws the 'Failed to load viewstate' exception.

1) Anyone have any better approach to this?
2) Or a way around the exception? maybe im adding the markup in a way that causes this?

+1  A: 

I would try the OnItemDataBound event instead of prerender.

Ricardo Villamil