The ASP.NET Web Site Administration Tool (WSAT) is used to manage user and role information for the website. The WSAT is only accessible locally and cannot be visited from the production website. However, by changing the connection string in the development environment to point to the production database you can use the WSAT to manage the users and roles on the production website.
Following are the steps given below:
1) Create Database (e.g. Test) in SQL Sever.
2) Run this command in command window to create the basic structure for user and role management
c:\windows\Microsoft.Net\Framework\v4.0.30319\aspnet_regsql.exe
3) Create Project in Visual Studio (as per now checked it on Visual Studio 2010).
4) Set the connection string in web.config
<connectionStrings>
<add name="conApplicationServices" providerName="System.Data.SqlClient" connectionString="Data Source=TEST-PC;Initial Catalog=Test;user ID=sa;password=evontech; Connection Timeout=0" />
</connectionStrings>
5) Add Membership and Role Manager Configuration in web.config
<membership defaultProvider="ReviewMembership">
<providers>
<clear />
<add type="System.Web.Security.SqlMembershipProvider" name="ReviewMembership" connectionStringName="conApplicationServices" applicationName="TestWebAppForWSAT" />
</providers>
</membership>
<roleManager enabled="true" defaultProvider="ReviewRole">
<providers>
<clear />
<add type="System.Web.Security.SqlRoleProvider" name="ReviewRole" connectionStringName="conApplicationServices" applicationName="TestWebAppForWSAT" />
</providers>
</roleManager>
6) See ASP.Net Configuration Icon at the rightmost corner of the Solution Explorer of your created Project. Click it and you will get Port then open it in the browser, you will get the below screen.
7) Go to Security Tab and then Create User Link to create the user, you will get the below screen
8) Now you can create users and manage their roles. The users will get store in table aspnet_Users.
By using these steps one can create and manage users using WSAT.
ASP.NET includes a number of built-in Login-related Web controls that implements the same functionalities as of WSAT controls do.
For example,CreateUserWizard control in Visual Studio to create user and the page for creating users in the WSAT shown in 7 step uses the same CreateUserWizard control.
With Membership and Roles classes in the .NET Framework one can write code to create, edit, delete users and roles, and to perform other users and roles related tasks.
Though WSAT offers a quick way to manage users and roles on production, but it does not work well for websites with multiple administrators or with administrators who do not have or are not familiar with Visual Studio and the WSAT. For these reasons, most websites that support user accounts include a set of administrative web pages.
Hope this will help you!
0 Comment(s)