在web.config中添加如下信息,即可。
<authentication mode="Forms"> <forms cookieless="UseCookies" loginUrl="~/account/login" timeout="2880"/> </authentication>