I'm triing to extend the LLBLGen GUI Templates. (LLBLGen Pro 2.5, Adapter, SQL Server)
I use the generated UserControls Search<EntityName>.ascx in other Pages.
based on the ListSubset.aspx, I'd like to implement the searcherClicked Eventhandler in the aspx-Page to retrieve the Predicate and display the Predicate in a Label, but it thows a NullReferenceException in the .ToQueryText Method:
System.NullReferenceException was unhandled by user code
Message="Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt."
Source="SD.LLBLGen.Pro.DQE.SqlServer.NET20"
StackTrace:
bei SD.LLBLGen.Pro.DQE.SqlServer.SqlServerSpecificCreator.CreateParameter(IEntityFieldCore field, IFieldPersistenceInfo persistenceInfo, ParameterDirection direction, Object valueToSet)
bei SD.LLBLGen.Pro.ORMSupportClasses.FieldCompareValuePredicate.ToQueryText(Int32& uniqueMarker, Boolean inHavingClause)
bei SD.LLBLGen.Pro.ORMSupportClasses.PredicateExpression.ToQueryText(Int32& uniqueMarker, Boolean inHavingClause)
bei SD.LLBLGen.Pro.ORMSupportClasses.PredicateExpression.ToQueryText(Int32& uniqueMarker)
bei HelperControls_SearchMultiView.searcher_SearchClicked(Object sender, EventArgs e) in j:\Entwicklung\ZKS2007\Head180208\Server\WebApplication\WebSite\HelperControls\SearchMultiView.ascx.cs:Zeile 150.
bei Controls_SearchWebPersonal.btnSearchSubSet_Click(Object sender, EventArgs e) in j:\Entwicklung\ZKS2007\Head180208\Server\WebApplication\WebSite\Controls\SearchWebPersonal.ascx.cs:Zeile 248.
bei System.Web.UI.WebControls.Button.OnClick(EventArgs e)
bei System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
bei System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
bei System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
bei System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
bei System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
The coresponding code Snippet:
private ISearchControl _searcher;
private void searcher_SearchClicked(object sender, EventArgs e)
{
if (_searcher != null)
{
int i = 0;
_searcher.Filter.DatabaseSpecificCreator = new SD.LLBLGen.Pro.DQE.SqlServer.SqlServerSpecificCreator();
lblFilter.Text = _searcher.Filter.ToQueryText(ref i);
}
}
any ideas?