当前位置:编程学习 > C#/ASP.NET >>

关于login控件的一个问题

系统使用了asp.net2.0里面的login控件。

现在的情况是:
    按F5后,不论你设置的起始页时什么。它都自动跳转到login.aspx。而且,你在地址栏上直接修改成其他叶面,都会自动跳回来。反正你不登陆就是不让你看。

我希望的情况是:
    我不登陆,我也能看其他页面。就是说,把这个login的功能搞失效了。

请问各位有什么方法

谢了 --------------------编程问答-------------------- 看看你的Webconfig里面是不是加了验证 --------------------编程问答-------------------- <?xml version="1.0"?>
<!-- 
    Note: As an alternative to hand editing this file you can use the 
    web admin tool to configure settings for your application. Use
    the Website->Asp.Net Configuration option in Visual Studio.
    A full list of settings and comments can be found in 
    machine.config.comments usually located in 
    \Windows\Microsoft.Net\Framework\v2.x\Config 
-->
<configuration>
<appSettings>
<add key="nHibernateSession" value="tcp://localhost:8085"/>
<add key="logger" value="tcp://localhost:8085/logger.rem"/>
<add key="Authentication.AuthSvc" value="http://localhost/Authentication/AuthSvc.asmx"/>
<add key="smtp" value="localhost"/>
<add key="host" value="roxio.com/registration"/>
<add key="emailtemplate.verification" value="~/templates/registration_confirmation.htm"/>
<add key="emailtemplate.welcome" value="~/templates/registration_welcome.htm"/>
<add key="emailtemplate.passwordrecover" value="~/templates/registration_passwordrecover.htm"/>
</appSettings>
<connectionStrings/>
<system.web>
    <globalization 
           requestEncoding="utf-8"
           responseEncoding="utf-8"/>
    <machineKey validationKey="70DF5A9B3345A6AAC0ED13877933030A25E2ECD3AC75554F" decryptionKey="DF975C511A2DCEDCF6B264F66076F61B8F101EAF0EE085A4" validation="SHA1" decryption="AES"/>
    <membership defaultProvider="MyRoxioProvider">
      <providers>
        <add name="MyRoxioProvider" type="MyRoxio.Business.Membership.MyRoxioMembershipProvider"
             passwordFormat="Hashed"/>
        <add name="SonicMembershipProvider"
            applicationName="AdminServices"
            enablePasswordRetrieval="false"
            enablePasswordReset="false"
            requiresQuestionAndAnswer="false"
            requiresUniqueEmail="true"
            passwordFormat="Hashed"
            type="SonicSecurityManagement.Membership.InternalMembershipProvider"/>
      </providers>
    </membership>

    <pages enableEventValidation="false"/>
<!-- 
            Set compilation debug="true" to insert debugging 
            symbols into the compiled page. Because this 
            affects performance, set this value to true only 
            during development.
        -->
<authentication mode="Forms">
</authentication>
    
<authorization>
      <allow roles="Admin"/>
      <deny users="*"/>
</authorization>

    <roleManager enabled="true" defaultProvider="SonicRoleProvider">
      <providers>
        <add name="SonicRoleProvider" type="SonicSecurityManagement.Roles.InternalRoleProvider" applicationName="AdminServices"/>
      </providers>
    </roleManager>
    
<customErrors defaultRedirect="~/error.aspx" mode="RemoteOnly"/>
<compilation debug="true">
<assemblies>
<add assembly="System.Runtime.Remoting, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="Microsoft.VisualC, Version=8.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="vjslib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/></assemblies>
</compilation>
<!--
            The <authentication> section enables configuration 
            of the security authentication mode used by 
            ASP.NET to identify an incoming user. 
        -->
<!--
            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> --------------------编程问答-------------------- 这就使web.config的内容了
除了一个membership标签外。我没发现什么特别的地方啊
可是我对membership不是很了解
请各位帮帮忙 --------------------编程问答-------------------- <authorization>
      <allow roles="Admin"/>
      <allow users="*"/>
</authorization>试试看,没用2005 --------------------编程问答-------------------- 帮顶 --------------------编程问答-------------------- bill1315(apple) :
你是让我怎么试呢?sorry, 没看懂 --------------------编程问答-------------------- <allow users="*"/>
其中*代表所有用户都可访问,2005我也没用过,你试试吧 --------------------编程问答-------------------- 你贴的web.config里有这一项呀,你可以改下:
<authorization>
      <allow roles="Admin"/>
      <allow users="*"/>
</authorization> 
或者加上:
<location path="webform.aspx">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>
webform.aspx就是你不想跳转login.aspx的页面
补充:.NET技术 ,  C#
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,