The Auros Blog

Auros: the internet consultancy and technology company

3May2012

EPiServer User and Group Search Providers

A couple of weeks back whilst on the train to London to take my ECD exam, I started to create a set of search providers to enable searching of users and groups from the EPiServer quick search bar.

Behind the scenes it’s very simple and makes use of pre existing functionality in EPiServer and the membership/role provider model.

One of the most difficult elements to solve was in creating the links which navigate to the user and group pages for editing. If you follow the direct page links the admin left menu and header links are not maintained. To overcome this, the default admin page can be loaded with a query string parameter (of customdefaultpage) which will set the address of the main frame with the page you wish to load. For Example, loading the default admin page and specifying the main frame to load the edit user screen on a SQL Membership Provider user named Adam (me!) would look like this:

/ui/admin/default.aspx?customdefaultpage=Admin/EditUser.aspx?membershipUsername=Adam&Provider=SQLMembershipProvider

Additionally, (and as you will see in the code) two extra processing steps must be taken:

  1. Both address need to be resolved to the correct path for your UI configuration using UriSupport.ResolveUrlFromUIBySettings.
  2. The URL passed as the customdefaultpage parameter must be url encoded as it too will contain a querystring.

So now after completing my ECD exam! I have finished the code and the source can be downloaded here.

So in a nutshell, the providers will:

  • Enable users and groups to be searched from quick search bar
  • Provide partial name searching for users and groups
  • Only be available to members of Administrators and WebAdmins groups

Download, Modify and use at your leisure!

About

Lead developer in the Engine Room. Worked in software development since 2002 - in this time he has worked with many different programming languages, frameworks and people. Favourite place: hitting up some breakpoints in debug mode!

Read more...

Comments (0) Trackbacks (0)

No comments yet.

Leave a comment


No trackbacks yet.