Jul
4
Written by:
New Age Solution
7/4/2009 11:03 AM
This will quickly show you how to create ASP.NET membership database and start using Visual Studio to create users, and roles.
- Open Visual Studio 2008 command prompt
- execute from command prompt: aspnet_regsql -S (local) -E -d SLTrainingDemo -A all
- Copy following to Web.conifg
in configuration node
<connectionStrings>
<remove name="LocalSqlServer" />
<add name="LocalSqlServer" connectionString="Data Source=(local);Initial Catalog=SLTrainingDemo;integrated security=true" providerName="System.Data.SqlClient" />
connectionStrings>
in system.web node
<authentication mode="Forms" />
<roleManager enabled="true"/>
<profile>
<properties>
<add name="Color" type="string" defaultValue="Red"/>
properties>
profile>
<membership defaultProvider="CustomizedProvider">
<providers>
<add name="CustomizedProvider" type="System.Web.Security.SqlMembershipProvider"
connectionStringName="LocalSqlServer"
applicationName="SLTrainingDemo"
minRequiredPasswordLength="5"
minRequiredNonalphanumericCharacters="0"/>
providers>
membership>
in configuration node add
<system.web.extensions>
<scripting>
<webServices>
<authenticationService enabled="true" requireSSL="false"/>
<profileService enabled="true" readAccessProperties="Color" writeAccessProperties="Color"/>
<roleService enabled="true"/>
webServices>
scripting>
system.web.extensions>
- From VS 2008: WebSite -> ASP.NET Configuration OR If using Web Application then choose Project -> ASP.NET Configuration

- Create users and roles from security

1 comment(s) so far...
ASP.net roles
Iam pretty new to Membership and Role Management in ASP.Net, hope you will be right person in helping me out.
As per my knowledge, assigning permissions to roles can be done at folder level.
I have to build a custom Website administrator tool which uses the ASPNetDB database(available with .net framework), it should have an option to create roles and edit them in such a way that the users should be able to assign permissions to the roles at page level and also at functionality level within that Page for each role.
By Ganesh on
5/22/2010 9:30 AM
|