Saturday, February 04, 2012
Blog
Jul 4

Written by: New Age Solution
7/4/2009 11:03 AM  RssIcon

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

Tags: ASP.NET
Categories:

1 comment(s) so far...


Gravatar

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

Your name:
Gravatar Preview
Your email:
(Optional) Email used only to show Gravatar.
Your website:
Title:
Comment:
Security Code
Enter the code shown above in the box below
Add Comment   Cancel 


Tags


Blog Archive


Blog List


Search Blog


Google Reader


Blog Comments
re:
I’m impressed. Very informative and trustworthy blog does exactly what it sets out to do. I’ll bookmark your weblog for future use.

Joseph
www.joeydavila.com
Your online Library
Re: Silverlight 4 PathListBox
Nope you dont need blend.
Re: Silverlight 4 PathListBox
I have visual studio 2010, do you have to have expression blend to execute the above code? Thanks.
re:
I’m impressed. Very informative and trustworthy blog does exactly what it sets out to do. I’ll bookmark your weblog for future use.

Joseph
www.joeydavila.com
Your online Library
re:
I’m impressed. Very informative and trustworthy blog does exactly what it sets out to do. I’ll bookmark your weblog for future use.

Joseph
www.joeydavila.com
Your online Library
Re: How to fix TF215032 when trying to delete Build Definition from TFS?
Thanks you very much.
Re: DotNetNuke PermanentRedirect Error
Thanks so much for posting this! It fixed my issue.
Re: Why we are using our own custom blog using DotNetNuke?
Word Press is good too. see Blog.ToeTapz.com. Depends on what you need. I use DNN blog because it gives me ultimate control on what I want and what I need. Also I need to be able to upload Silverlight demo so I use DNN. BlogToeTapz.com I recently got is using word press and I been happy with it so far.
I am testing DNN blogs and they are not as good as blogger.com
Are there any other DNN blogs we can use for this?

http://newmediaworlds.blogspot.com/





Re: How to add Google Email, Calendar, and contacts to Blackberry and iPhone?
Great and detail instructions. I got just got my Blackberry 8350 and it's a very useful information for me as a newbie.


Syndicate  

Privacy Statement  |  Terms Of Use
Copyright 2010 New Age Solution