现在的位置: 首页 > 综合 > 正文

利用ASP.NET 2.0 login系列控件

2011年02月11日 ⁄ 综合 ⁄ 共 2221字 ⁄ 字号 评论关闭

我个人感觉这几个控件还不错,但是不能满足大的项目,昨天弄了一下,随便托进去,利用ASPNETDB数据库,简直太容易了,代码都不用写。

Web.Config配置如下:

<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
    
<appSettings>
        
<add key="maojiguo" value="yes" />
    
</appSettings>
    
<connectionStrings>
        
<add name="MYDBConn" connectionString="server=(local);trusted_connection=false;user id=sa;pwd=;database=cigem" providerName="System.Data.SqlClient"/>
        
<remove name="LocalSqlServer" />
        
<add name="LocalSqlServer" connectionString="server=(local);trusted_connection=false;user id=sa;pwd=;database=cigem" providerName="System.Data.SqlClient" />
    
</connectionStrings>

    
<system.web>
      
<customErrors defaultRedirect="" />
      
<authorization>
        
<allow roles="管理员" />
      
</authorization>
      
<roleManager enabled="true" />
      
<membership defaultProvider="LocalSqlServer">
        
<providers>
          
<add connectionStringName="LocalSqlServer" name="LocalSqlServer"
            type
="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
        
</providers>
      
</membership>

      
<!-- 
            Set compilation debug="true" to insert debugging 
            symbols into the compiled page. Because this 
            affects performance, set this value to true only 
            during development.
        
-->
        
<compilation debug="true"/>
        
<!--
            The <authentication> section enables configuration 
            of the security authentication mode used by 
            ASP.NET to identify an incoming user. 
        
-->
        
<authentication mode="Forms" />
        
<!--
            The <customErrors> section enables configuration 
            of what to do if/when an unhandled error occurs 
            during the execution of a request. Specifically, 
            it enables developers to configure html error pages 
            to be displayed in place of a error stack trace.

        <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
            <error statusCode="403" redirect="NoAccess.htm" />
            <error statusCode="404" redirect="FileNotFound.htm" />
        </customErrors>
        
-->
    
</system.web>
</configuration>

抱歉!评论已关闭.