This topic is locked
[SOLVED]

 What happend to the Event "List page: Before SQL query" in ASPRunner.NET 9.7

3/9/2017 2:19:38 PM
ASPRunner.NET General questions
T
tetter author

Hi everybody
We installed ASPRunner.NET 9.6 a few days ago and yesterday we installed 9.7.
We used the Event "List page: Before SQL query" in order to add the LanguageID in order to filter the selected language.
Now with Version 9.7 the other pages, where we did not yet use the event, it is not "offered" any more in the ASPRunner.NET interface.
Where did it go ... or is there a better alternative?
Thanks, TomE

T
tetter author 3/13/2017

Event "List page: Before SQL query" is obsolete. Use AfterTableInit:

https://xlinesoft.com/asprunnernet/docs/dynamic_sql_query.htm

Pete K 3/14/2017

This is a good thing. I kept putting code in there and it was not working as expected. One drawback to the new way is that code placed in AfterTableInit() gets applied to all pages based on that table, whereas with BeforeQueryList() you could apply code to a specific page. One example of this was in a case where I wanted to apply a dynamic filter at run time on a list page but not have it restrict the view record pages. My solution was to place the code in the AfterTableInit() but have it test for the presence of "list" in the URL:

// FILTER FOR LIST PAGE ONLY

string pageX = HttpContext.Current.Request.Url.AbsolutePath;

if (pageX.Contains("list")

{

// my filter code here

}