利用ASP.NET 2.0 login系列控制項

來源:互聯網
上載者:User

我個人感覺這幾個控制項還不錯,但是不能滿足大的項目,昨天弄了一下,隨便托進去,利用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>
相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.