Populating text box filters with URL query string parameter values - SharePoint Zen - ROXORITY ™ Sensational SharePoint Solutions
User Voices
(Loading...)
Our blog on SharePoint add-ons and solutions development
« Missing the List View selector tool-bar drop-down menu in SharePoint 2010? Introducing the new List View Picker. | Main | Enabling CAML Filtering Mode for Data View Web Parts »
Monday
Apr052010

Populating text box filters with URL query string parameter values

One easy way to pre-populate a single SharePoint FilterZen filter of yours via the page URL query string is using the parameter name filter_DefaultValue after having ticked the Override Web Part settings from URL parameters check-box option in the Filter Web Part's settings tool pane.

But what should you do if you need multiple parameters for multiple filters, or simply other, custom parameter names? This is actually fairly easy:

  • For each Text Filter to pre-populate, add one corresponding URL Query String Filter.
  • Give it any name you wish but this should be different from the corresponding Text Filter — for example, assuming your Text Filter is named City, then name your URL Page Request Filter CityParam or simply C or any other name.
    • Important: disable your helper URL / Page Request Filters so that their values do not get sent to connected Web Parts directly, but are only used to pre-populate your Text Filters! Simply un-tick the This filter is enabled check-box option for each URL filter.
  • For the default filter value option of the Text Filter, specify {$CityParam$} or {$C$} or whatever URL / Page Request Filter name you picked in the previous step.
  • Now you can use the respective URL query string parameters, for example: page.aspx?CityParam=Hanoi or page.aspx?C=Zurich.
    • If you want the URL parameter name to be different from your URL filter name, then simply set that filter up accordingly by following the GUI instructions.

Reader Comments

There are no comments for this journal entry. To create a new comment, use the form below.
Member Account Required
You must have a member account on this website in order to post comments. Log in to your account to enable posting.