Filtering via URL
Hi All,
I'm looking to create a custom module and then filter the list view based on the URL. For example:
http://myurl/programs - would list all programs
http://myurl/programs/NH - all program within NH
I've been looking through the documentation and haven't quite been able to get a handle on how to accomplish this. Any pointers?
Thanks,
Jason
Jason, Sitefinity routing converts requests like this into parameters in the RouteData.Values property of the Request. You can absolutely retrieve these from your controls to get specific items based on these parameters.
Take a look at this post that explains how you might do this: http://www.sitefinity.com/devnet/forums/preview-thread/sitefinity-4-x/general-discussions/how-do-i-construct-a-dynamic-page-url-in-sitefinity.aspx
This is the same procedure used for the Intrasite Testimonials Module example from the Sitefinity SDK.
Another key element is the method:
RouteHelper.SetUrlParametersResolved();