易截截图软件、单文件、免安装、纯绿色、仅160KB

ASP.net 2.0 学习用户配置文件(二)

 默认情况下,匿名用户不能修改profile属性,问题在于ASP.NET Framewor没有办法关联Profile数据和特定的用户,除非用户是经过身份验证的。
如果希望匿名用户修改profile的属性,必须启用ASP.NET Framework的匿名认证(Anonymous Identification)的功能。当开启这个功能时,一个标识(一个GUID)被分配给匿名用户,并保存在持久化的浏览器cookie中。并且必须启用allowAnonymous标识所有希望匿名用户可以修改的profile属性。
Web配置文件示例代码:<打印机>
<authentication mode="Forms"/>
<anonymousIdentification enabled="true"/>
<profile>
<properties>
<add name="numberOfVisits" type="Int32" allowAnonymous="true"/>
</properties>
</profile>
如此一来便可以匿名访问与赋值了。
推荐链接:复印机/长宸办公


相关文档:

ASP.NET页面刷新方法总结

先看看ASP.NET页面刷新的实现方法:
第一:
private void Button1_Click( object sender, System.EventArgs e ) { Response.Redirect( Request.Url.ToString( ) ); } 第二:
private void Button2_Click( object sender, System.EventArgs e ) { Response.Write( " < script language=javascript>window.locatio ......

asp.net跨页投递

 1.TextBox txt=(TextBox)PreviousPage.FindControl("TextBox1");
2.在页面注册投递页的属性
 <%@ PreviousPageType VirtualPath="crouspostPage.aspx" %>
在crouspostPage.aspx的代码隐藏类中添加
public TextBox TextBox1
{
 get(return _textbox);
}
在页面中Response.Write(PreviousPage. ......

asp.net性能

 1.关闭不必要的Session
<%@ Page EnableSessionState="flase"%>
2.关闭不必要的ViewState
<asp:DataGrid EnableViewState="false" runat="server">
如果页面级
<%@ Page EnableViewState="false"%>
3.不要使用Exception控制程序流程
  Exception是很耗资源的
4.禁用VB和JScript动态数 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号