I am working on one project where I have simple custom table data list webpart. I need to filter this data using query string where date is submitted. e.g: domain.com?date=2015-01-23. I need where condition macro with the following logic. If date parameter is passed than filter otherwise list unfiltered data. How can I achieve this? I have tried following code:
{%
result = "";
if (QueryString.startDate != null)
{
result = "StartDate = " + QueryString.startDate|(handlesqlinjection)true;
}
else
{
result = "StartDate >" + "1900-01-01".ToString();
}
return result;
%}
Thank you
↧