Quantcast
Channel: Sitecore Fetch Squad » Minipost-5
Viewing all articles
Browse latest Browse all 3

typesThatShouldNotBeExpanded

$
0
0
After having ran into this myself a few times, and for the 5th time being asked by one of my Sitecore friends; I though I would bring this one up.

Ever had trouble getting your ASP.NET ListView controls to retain ViewState or do standard Paging?

As many of you will know, Sitecore’s web.config is a source of endless configuration fun. Sitecore’s modular nature is basically founded on this configuration – want to switch something around or change how Sitecore works (at your own risk, usually, but that’s ok)? Web.config is the place to go.

Many of the settings are self explanatory and well commented, so working out what they do is fairly straight forward. In some cases, they are not, however.

If you look through, you will find an element named “
typesThatShouldNotBeExpanded”.

In it you will find two entries:

  • System.Web.UI.WebControls.Repeater
  • System.Web.UI.WebControls.DataList

And while I don’t have enough insight into exactly HOW Sitecore ties in to the ASP.NET lifecycle to determine exactly WHY this setting is needed, I can however tell you what happens if you don’t fully control it.

Say you have a control, where you drop in an ASP.NET ListView Control. Or a GridView control. They’ll appear to work fine at first, but you’ll quickly notice that paging and viewstate is acting up a bit on your controls.

The fix for this is easy, and as far as I know this is well known by Sitecore Support. Add your controls to this – almost black magic like – web.config setting, and you’re set :-)

So

Add System.Web.UI.WebControls.ListView, and System.Web.UI.WebControls.GridView to this collection if you find paging, viewstate or other things “that normally works” doesn’t.

I don’t know when this setting was introduced, or even IF there is a reason Sitecore doesn’t include these common controls in the list. Maybe there’s a negative effect on performance or otherwise.

Searching on the web only produces this one link (searching on SDN, two results but similarly without explanation), and that doesn’t tell us anything else than the config setting was apparently introduced in Sitecore 5.3.2 071220.

Into the core


© admin for Sitecore Fetch Squad, 2009. | Permalink | No comment | Add to del.icio.us
Post tags:

Feed enhanced by Better Feed from Ozh


Viewing all articles
Browse latest Browse all 3

Trending Articles