I've developed a custom server control to handle displaying search results (including paging) for use in Sitecore. The control works OK to a point, except that the paging mechanism does not work. I've hand crafted the paging mechanism and it consists of LinkButton
s which trigger an event handler method in the code-behind. Now the paging mechanism works fine outside of Sitecore, but does not seem to work in the Sitecore environment (it triggers postbacks OK, but the 'paging' event is not being fired). In a previous question of mine (Is there a way to do low-level debugging of ASP.NET PostBacks) someone mentioned the typesThatShouldNotBeExpanded
web.config setting in Sitecore which has fixed a similar issue with standard asp.net server controls (a ListView in that case), but this technique doesn't seem to work for my server control.
Is there some other setting I need to use to register my assembly with sitecore, before the typesThatShouldNotBeExpanded
setting can take effect?
The reason this didn't work was because I had forgotten to make my control class inherit from System.Web.UI.WebControls.CompositeControl
- when I said I had tested this outside of Sitecore, I had tested a very similar version of the code, but which did inherit the CompositeControl base class. This is required for server controls which contain child controls. Note, It was still necessary for the web.config file to contain the appropriate setting.