Search Users with FindUsersByName Method?

Jun 21, 2009 at 3:52 PM
Edited Jun 26, 2009 at 3:35 PM

How do you use the FindUsersByName method with a wildcard using the XML Membership Provider? With this provider, it only returns the exact input if the input it a user. For example, if I was to type in "Demo", I would only get "Demo". However, I want to work so that if you type in "Demo" you get "Demo", "Demo1", "Demo12", ect - for this, I would need to use a wildcard, however, I don't believe this provider has a wildcard. How would I make this work? These posts(here and here)were helpful, but only if you use an SQL provider - I would like to know how to use this, the wildcard search, with this provider.

Jun 26, 2009 at 3:34 PM
Edited Jul 10, 2009 at 11:43 AM

I was thinking of some ways to make this method work, however, I think it may be best to create a seperate method or fuction using Linq to XML. I tink the steps for this custom way to find users would be to :

1) Load the users document (I tried Server.MapLocation("~/App_Data/Users.xml") - But I'm not sure if it was connecting correctly)

2)Get the information from the search box, and then search the inner text of each node that stores the username(Element - UserName) in each parent element of XmlUser for any username that begins with the text in the search box.

3)The method or function(I'm not sure about the terminology) would then display all usernames that fit the begin with the name requested.

I'm not sure how exactly you would create this, and when I tried to make somthing like this, it wouldn't display any information. Perhaps someone knows how to make this happen, or how to use a wildcard with the XML Membership provider?

Jul 10, 2009 at 2:18 PM

Hi all,

I was just wondering if there was any progress made towards resolving this situation, or if anybody has had this problem before and has fixed it.



Jul 11, 2009 at 7:26 AM


I'm currently working on that.


Aug 18, 2009 at 11:31 AM
Edited Aug 18, 2009 at 11:39 AM


It is implemented and I will issue the next release by the end of the day.

Now, by default, that method will return all users which user names starts with provided usernameToMatch argument.