0

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?

Adam Naylor
  • 6,172
  • 10
  • 49
  • 69

1 Answers1

1

I would try the OnItemDataBound event instead of prerender.

Ricardo Villamil
  • 5,031
  • 2
  • 30
  • 26