Asp.net web site administration tool custom provider




















In your web. The content you requested has been removed. Ask a question. Quick access. Search related threads. Remove From My Forums.

Asked by:. Archived Forums. Security for ASP. NET security authentication, authorization, membership, roles, etc. Sign in to vote. Monday, November 20, AM. Alternatively, you can select a different provider for each application feature. In the Web Site Administration Tool, on the Provider tab, your first choice is whether you want to use the same provider for all features or to select a provider individually for each application feature.

You can choose the following options:. To specify a single provider for all application features, click Select a single provider for all site management data. To specify providers for specific application features, click Select a different provider for each feature advanced , and then select a provider for each application feature.

The Provider tab manages configuration settings that are stored in the Web. The following code is the Web. For more information, see the following sections in the. SqlProfileProvider, System. All data about users, their profiles and roles are stored in SQL Server data store. As I already specified, there is a pre-build data store structure.

So, you don't have to lose precious time creating tables, relations between tables and stored procedures. For the profile system, tables are created after you specify the profile properties in the web. Let's name this page ManageUsers. The user interface for this page can be divided into three parts:. The first part shows the number of registered users. It also shows how many of them are currently online. The second part provides features for searching and listing the users.

There is an "alphabet bar" with all the letters of the alphabet; when one is clicked, a grid is filled with all the users having names starting with that letter.

There is also a facility to search for the users by providing a partial username or e-mail address. In he third part with the help of a grid you can lists users and some of their profile properties.

For the alphabet bar I used a Repeater control, instead of a fixed list of links. To this Repeater control I bounded an array of characters that will finally be displayed as links. So, if later you want to remove certain characters from your alphabet bar, you will only have to remove those letters from that array.

The third part of the page contains a Gridview that will lists users and some of their properties. All we need is to specify the number and the type of columns for this grid.

Below you will find the description for each column:. For the username, the creation date and last access date we will use BoundField columns. These values for these data will be displayed as strings. For user's e-mail use a HyperLinkField to show the as an active link that uses the mailto: protocol. To redirect the administrator to a page called EditUsers. This link will have the username as a querystring value and will allow the administrator to edit a user's profile. To delete a user use a ButtonField column to create a graphical Delete button.

To do this set the column's ButtonType property to "Image". This new feature was introduces only for ASP. In the page's code-behind file there is MemershipUserCollection object. This object is initialized with all the user information returned by Membership. GetAllUsers static method.

In the Load event of this page we will use the Count property of this collection to display the total number of registered users and also the number of online users. I also created an array that contains letters that will be bound to the Repeater control in order to create the alphabet.

ToString ; lblTotalUsers. Split ';' ; rptAlphabetBar. When the administrator will click a letter link, the ItemCommand event of the Repeater control will raise. Here we will retrieve that letter and search for all users with the name that starts with that letter. When you click the All link, the gridview will show all the users. This search mode is stored in the Attributes collection of the gridview so that it is persisted in the view state, and doesn't get lost during a postback.

Here's the code:. Add "SearchByEmail" , false. ToString ; if e. Add "SearchText" , e. Add "SearchText" , "" ; this.

In this event the BindAllUsers method is called. NET Website Administration Tool should pick up on any providers you have defined in your config file custom or otherwise. NETWebAdminFiles" to your live site, although I tend to only use it in my development environment to quickly add users and roles for testing and then use my own web forms hooked into the provider on the live site more for styling and formatting reasons than any other though.

Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow.

Learn more. Asked 12 years, 8 months ago. Active 12 years, 8 months ago. Viewed 1k times.



0コメント

  • 1000 / 1000