表单身份验证 - 在运行时更改loginUrl

时间:2012-05-16 21:19:05

标签: c# asp.net web-config forms-authentication

我的web.config中有这样的东西:

<authentication mode="Forms">
      <forms loginUrl="MyVirtualDirectory/Login/Login" protection="All" timeout="15" />
</authentication>

但是,我正在尝试实现一些“假的”虚拟目录,似乎无法弄清楚如何在运行时使loginUrl的“MyVirtualDirectory”部分动态化。

Reading this MSDN article,似乎我可以设置此属性,但是将其添加到Application_Start或Application_BeginRequest似乎不起作用。

有任何帮助吗?谢谢!

0 个答案:

没有答案