2012-02-29 105 views
0

我有我的asp.net网站的html登陆页面,但是我不能给它显示它总是去登录。在asp.net中的Html登陆页面

我可以在web.config中设置什么来解决这个问题?

我已经试过

<authentication mode="Forms"> 
    <forms defaultUrl="index.html" loginUrl="~/Account/Login.aspx" timeout="2880" /> 
</authentication> 

<location path="index.html"> 
<system.web> 
    <authorization> 
    <allow users="?" /> 
    </authorization> 
</system.web> 

<defaultDocument> 
    <files> 
    <clear /> 
    <add value="index.html" /> 
    </files> 
</defaultDocument> 

所有没有运气。请帮助 在此先感谢

这里是我的全部的web.config

<configuration> 
    <connectionStrings> 
    <!--<add name="ApplicationServices" connectionString="Data Source=.\sqlexpress;Initial Catalog=ArctixDb;Integrated Security=SSPI;"/>--> 
    <add name="ApplicationServices" connectionString="" /> 
    <add name="ArctixDbEntities" connectionString="" /> 
    </connectionStrings> 
    <system.web> 
    <customErrors mode="Off" /> 
    <httpHandlers> 
     <add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" 
     validate="false" />  
    </httpHandlers> 
    <compilation debug="true" targetFramework="4.0"> 
     <assemblies> 
     <add assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" /> 
     <add assembly="Microsoft.ReportViewer.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" /> 
     <add assembly="Microsoft.Build.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" /> 
     <add assembly="System.Management, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" /> 
     <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" /> 
     </assemblies> 
     <buildProviders> 
     <add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> 
     </buildProviders> 
    </compilation> 
    <authentication mode="Forms"> 
     <forms defaultUrl="index.html" loginUrl="~/Account/Login.aspx" timeout="2880" /> 
    </authentication> 
    <membership> 
     <providers> 
     <clear/> 
     <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/" /> 
     </providers> 
    </membership> 
    <profile> 
     <providers> 
     <clear/> 
     <add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/" /> 
     </providers> 
    </profile> 
    <roleManager enabled="false"> 
     <providers> 
     <clear/> 
     <add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="ApplicationServices" applicationName="/" /> 
     <add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/" /> 
     </providers> 
    </roleManager> 
    <authorization> 
     <deny users="?" /> 
    </authorization> 
    </system.web> 
    <location allowOverride="true"> 
    <appSettings> 
     <add key="SMTPServer" value="" /> 
     <add key="SMTPServerPort" value="25" /> 
     <add key="SMTPServerSSL" value="false" /> 
     <add key="SMTPUsername" value="" /> 
     <add key="SMTPPassword" value="" /> 
     <add key="SystemEmailAddress" value="" /> 
     <add key="SystemEmailAddressName" value="" /> 
    </appSettings> 
    </location> 
    <location path="Styles"> 
    <system.web> 
     <authorization> 
     <allow users="?" /> 
     </authorization> 
    </system.web> 
    </location> 
    <location path="Account"> 
    <system.web> 
     <authorization> 
     <allow users="?" /> 
     </authorization> 
    </system.web> 
    </location> 
    <location path="images"> 
    <system.web> 
     <authorization> 
     <allow users="?" /> 
     </authorization> 
    </system.web> 
    </location> 
    <location path="index.html"> 
    <system.web> 
     <authorization> 
     <allow users="*" /> 
     </authorization> 
    </system.web> 
    </location> 
    <system.webServer> 
    <modules runAllManagedModulesForAllRequests="true" /> 
    <defaultDocument> 
     <files> 
     <clear /> 
     <add value="index.html" /> 
     </files> 
    </defaultDocument> 
    <validation validateIntegratedModeConfiguration="false" /> 
    <handlers> 
     <add name="ReportViewerWebControlHandler" preCondition="integratedMode" verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> 

    </handlers> 
    </system.webServer> 
</configuration> 
+0

什么是您的iis版本? – Illuminati 2012-02-29 06:53:00

+0

我由一个提供商托管,该提供商在index.html上设置了默认页面。如果我删除了web.config,它的工作原理是 – Jed 2012-02-29 07:00:48

+0

,您是否在授权下尝试? – Illuminati 2012-02-29 07:00:52

回答

0

我最终只是把我的登录页面登陆页面

0

你可以构建你的站点如下?

  • 允许根目录/风格/等,以允许匿名访问
  • 添加一个“安全”目录及其自己的web.config,指定窗体身份验证

任何外界“安全”将是无障碍。