Servergrid UserLink

... connection ... education ... discovery ... information ...
Welcome to Servergrid UserLink Sign in | Join | Help
in
Home Blogs Forums Photos Downloads Servergrid Join Now Private Messages

ASP.NET Membership and Roles Administrator problems in Visual Studio FTP access

Last post 03-30-2007, 12:10 PM by csnoke. 2 replies.
Sort Posts: Previous
  • ASP.NET Membership and Roles Administrator problems in Visual Studio FTP access

     03-29-2007, 11:36 PM

    • Joined on 03-30-2007
    • Posts 3
    • Points 17
    • Top 50 Contributor

    Just a heads up to people who might run across the same problem I ran into tonight regarding the Membership and Roles Manager built into Visual Studio/Web Developer. I was getting an error when I tried to launch the "Administrate Website," after I connected to my asp.net site via ftp. As it turns out, the administrative tool is not supported across file transfer protocol... and while this may seem apparent now, at the time I was scratching my head wondering what I'd managed to screw up.

    The problem was a scary one because as far as I know (other than frontpage ext.) FTP is the only way to access my hosting plan... I HAVE to be able to administer roles and profiles... the two just didn't want to work together.

     So, if you run into this problem yourself I invite you to read Peter Kellner's articles on membership role management with ISS:

    http://peterkellner.net/2006/01/08/microsoft-aspnet-20-memberrole-management-with-iis-part-1-security-and-configuration-overview/

     http://peterkellner.net/2006/01/09/microsoft-aspnet-20-memberrole-management-with-iis/

     

    I guess what it all boils down to, is this great front end for managing your users and roles from an aspx page, it can be downloaded here in VB:

    http://peterkellner.net/2007/02/15/membershipodsvb/ 

    and 

    http://www.mindup.no/MembershipEditor.zip

     All you need to do is copy the three vb code pages into your project's App_Code Directory and the Admin.aspx to a secure directory and you're good to go. The Admin page provides the same functionality as the visual studio admin tool for editing and managing users and roles. The solution is also available in C#, you'll just have to do some digging on Kellner's site for it.

    Hope this helps someone! 

     

    By the way, I found these articles via Scott Gu here:

    http://weblogs.asp.net/scottgu/archive/2006/07/18/Remote-Membership_2F00_Roles-Management-of-ASP.NET-2.0-Applications.aspx
     

     


     

  • Re: ASP.NET Membership and Roles Administrator problems in Visual Studio FTP access

     03-30-2007, 9:39 AM

    Moderator
    Thank you, these look like excellent resources.  Another heads-up for anyone trying to do this: since SQL Express isn't licensed for shared hosting it will be necessary for you to create a MSSQL database to store this information.  This will also improve the scalability of your site over using SQL Express.  After creating your database, it will probably be necessary to configure the database using aspnet_regsql (http://msdn2.microsoft.com/en-us/library/x28wfk74.aspx), unless the project mentioned above has the capability to do this itself.  Your web.config can then be modified to use your MSSQL database to store the membership info.  This project should help a lot for anyone who needs to have ongoing management capability for their deployed site.

    Administration
    Servergrid - Windows Hosting Experts
    http://www.servergrid.com

  • Re: ASP.NET Membership and Roles Administrator problems in Visual Studio FTP access

     03-30-2007, 12:10 PM

    • Joined on 03-30-2007
    • Posts 3
    • Points 17
    • Top 50 Contributor

    You're exactly right. The aspnet_regsql will create the database that you'll need to use iinstead of the membership database file  that sql express  tells you to use.

    You can read up on it of the msdn link above if you run into problems... just example, here's what your modified web.config file should resemble:

     

    <?xml version="1.0"?>

    <configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
        <appSettings>
        </appSettings>
        <connectionStrings>

            <!--- you have to remove the default local sql server that comes with web developer express first ---!>
            <remove name="LocalSqlServer"/>

            <!--- then add the connection string to your database ---!>
            <add name="LocalSqlServer" connectionString="server=mssql4.securedc.com;uid=YOUR_DBO_USERNAME;pwd=YOUR_DBO_PASSWORD;database=YOUR_DB_NAME" providerName="System.Data.SqlClient"/>
        

    </connectionStrings>
        <system.web>


            <membership defaultProvider="AspNetSqlMembershipProvider">


                <providers>


                    <remove name="AspNetSqlMembershipProvider"/>

                     <!--- here you can specify password rules ---!>
                    <add connectionStringName="LocalSqlServer" name="AspNetSqlMembershipProvider" enablePasswordRetrieval="false" enablePasswordReset="true" applicationName="/" requiresUniqueEmail="false" passwordFormat="Hashed" maxInvalidPasswordAttempts="15" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" passwordStrengthRegularExpression="" requiresQuestionAndAnswer="true" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=***************"/>


                </providers>
            </membership>

            <roleManager enabled="true"/>
            <siteMap defaultProvider="XmlSiteMapProvider" enabled="true">
                <providers>
                    <add name="XmlSiteMapProvider" description="Default SiteMap provider." type="System.Web.XmlSiteMapProvider" siteMapFile="Web.sitemap" securityTrimmingEnabled="true"/>
                </providers>
            </siteMap>
            <compilation debug="true" strict="false" explicit="true" urlLinePragmas="true"/>
            <pages>
                <namespaces>
                    <clear/>
                    <add namespace="System"/>
                    <add namespace="System.Collections"/>
                    <add namespace="System.Collections.Specialized"/>
                    <add namespace="System.Configuration"/>
                    <add namespace="System.Text"/>
                    <add namespace="System.Text.RegularExpressions"/>
                    <add namespace="System.Web"/>
                    <add namespace="System.Web.Caching"/>
                    <add namespace="System.Web.SessionState"/>
                    <add namespace="System.Web.Security"/>
                    <add namespace="System.Web.Profile"/>
                    <add namespace="System.Web.UI"/>
                    <add namespace="System.Web.UI.WebControls"/>
                    <add namespace="System.Web.UI.WebControls.WebParts"/>
                    <add namespace="System.Web.UI.HtmlControls"/>
                </namespaces>
            </pages>

            <authentication mode="Forms"/>

            <customErrors mode="Off"/>
        </system.web>
    </configuration>
     

    So there you go, good luck! 

View as RSS news feed in XML
Powered by Community Server, by Telligent Systems