I have a data control defined like so:
<llblgenpro:LLBLGenProDataSource ID="llbComputerApplication"
DataContainerType="EntityCollection" runat="server" ThrowExceptionOnIllegalFieldInput="false"
EntityCollectionTypeName="Talisman.VistaDesktopSurvey.Domain.CollectionClasses.ComputerApplicationCollection, Talisman.VistaDesktopSurvey.Domain">
</llblgenpro:LLBLGenProDataSource>
In page_load, I had this code:
computerAppFilter.Add(ComputerApplicationFields.ComputerID = Me.xComputer.ComputerID)
Me.llbComputerApplication.FilterToUse = computerAppFilter
xComputer is a property on the form that loads a computer entity by pulling the ComputerID from the querystring. If this failed, I threw an exception, which properly is catched in the form load and processing stops. However, the page continues rendering, and since the FilterToUse never got set, the data controls (I have 3 like this) all did full select from the underlying table, causing a System.OutOfMemoryException.
So, my workaround for this was to put a bogus filter on the data control at the top of the page load:
Me.llbComputerApplication.FilterToUse = New PredicateExpression(ComputerApplicationFields.ComputerID = "xxxxxxxxxxxxxxxxxxxxxxxxx")
But, there must be a better way to do this....I feel like I am doing something wrong at a fundamental level.