The content you requested has been removed. Ask a question. Quick access. Search related threads. Remove From My Forums. Answered by:. Archived Forums. 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. Create Users in ASP. Asked 12 years ago. Active 12 years ago. Viewed 1k times. I am exploring the Membership class of the ASP. Edit to respond to comment Have you successfully logged in at all? SqlRoleProvider, System. Sorry for the delay in responding, was in a meeting all day. I get error: The configuration option 'user instances enabled' does not exist, or it may be an advanced option. What version of Sql server are you using? The above only works with the express editions. Please see the update I've added SQL Server full How Do I work with full version?
Follow the below steps For proper Membership integration to your website if you see the above error like " Could not establish a connection to the database. Step 5 Selecting Next button on above window takes you to confirmation window as below after successful installation of your application services database for ASP.
Ajay Ajay 1, 17 17 silver badges 32 32 bronze badges. SaltpeterBoom SaltpeterBoom 69 8 8 bronze badges. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password.
Post as a guest Name. Email Required, but never shown. The Overflow Blog. 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. The Boolean value that is passed as an input parameter indicates if the allRegisteredUsers collection must be repopulated especially when a user is deleted.
0コメント