c#中webconfig中的location的path设定了但是为什么不起作用?请高手解决
来源:百度知道 编辑:UC知道 时间:2024/06/15 06:26:53
<system.web>
<authentication mode="Forms">
<forms name=".ASPXAUTH" loginUrl="Login.aspx" defaultUrl="Default.aspx" timeout="60">
</forms>
</authentication>
<authorization>
<allow users="Admin"/>
<deny users="*"/>
</authorization>
</system.web>
<location path="test">
<system.web>
<authorization>
<deny users="*"/>
</authorization>
</system.web>
</location>
编译环境是vs2008,直接在程序中运行就可以,但是发布到IIS上后location中的path就不认了
用绝对路径好像不行吧
<authentication mode="Forms">
<forms name=".ASPXAUTH" loginUrl="Login.aspx" defaultUrl="Default.aspx" timeout="60">
</forms>
</authentication>
<authorization>
<allow users="Admin"/>
<deny users="*"/>
</authorization>
</system.web>
<location path="test">
<system.web>
<authorization>
<deny users="*"/>
</authorization>
</system.web>
</location>
编译环境是vs2008,直接在程序中运行就可以,但是发布到IIS上后location中的path就不认了
用绝对路径好像不行吧
试一下这个:
../Default.aspx
你在Config文件中设置一下绝对路径就可以了。
<forms name=".ASPXAUTH" loginUrl="Login.aspx" defaultUrl="Default.aspx" timeout="60">
改成相对路径看看