So, you created this big portal for your suppliers, customers or other in SharePoint. You have implemented FBA but now you want to search in this extensive list of people ?
Continuing on the FBA Codeplex solution by Stacy Draper, adding just a few lines of code can do this for you !
The FBA solution already has a Stored Procedure “Search User by Name”. You can use this (in addition you can also change this procedure to search on parts of the name).
Next, edit the UsersDisp.aspx file:
add in the content page the textfield and search button:
search on user name:
<form> <asp:textbox ID="tna" text="" runat="server"/> <asp:Button ID="searchbtn" OnClick="mkSarch" runat="server" text="Search"/> <asp:Button ID="clear" OnClick="mkEmpty" runat="server" text="Empty"/> </form>
Next, put some code in the script part of the page:
protected void mkSearch(object sender, EventArgs e)
{
if (tna.Text != “”)
{
searchUser(tna.Text);
}else
{
FillGrid();
}
}
protected void mkEmpty(object sender, EventArgs e)
{
tna.Text=””;
FillGrid();
}
protected void searchUser(string searchValue)
{
MembershipUser user;
MembershipUserCollection users = new MembershipUserCollection() ;
users = Membership.FindUsersByName(searchValue);
MemberGrid.DataSource = users;
MemberGrid.DataBind();
}
Et voila, now you should have a fully functional search on your FBA management page!
Becoming a developer mr. Somers?
Thanks for the information. Do you mind posting a copy of the userdisp.aspx file content? I am having trouble implement this solution.