此页当前禁用指定的显示模式。请确保为当前用户启用了个性化设置?
如题,我在使用webparts的时候出现的问题,哪个大侠知道怎么解决啊?在网上搜索了不少,都不能解决~~
------解决方案--------------------在web.config内添加
<authentication mode= "Forms ">
<forms name= "auth " loginUrl= "Default.aspx " timeout= "30 " defaultUrl= "一般用户应去页面如(Main.aspx) "> </forms>
</authentication>
<webParts enableExport= "true ">
<personalization defaultProvider= "AspNetSqlPersonalizationProvider ">
</personalization>
</webParts>
<membership>
<providers>
<clear/>
<add name= "AspNetSqlMembershipProvider " type= "System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a " connectionStringName= "数据库连接字符串名称 " applicationName= "/ "/>
</providers>
</membership>
登录按钮的click事件里添加
FormsAuthentication.SetAuthCookie(Session[ "用户名如(user) "].ToString(), true);
if (curUser.Username == "管理员 ")
Response.Redirect( "管理员应去页面如(sys/Manage.aspx) ");
else
Response.Redirect( "一般用户应去页面如(Main.aspx) ");