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>
如此一来便可以匿名访问与赋值了。
推荐链接:复印机/长宸办公
相关文档:
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生成静态HTML页!
环境:Microsoft .NET Framework SDK v1.1
OS:Windows Server 2003 中文版
ASP.Net生成静态HTML页
在Asp中实现的生成静态页用到的FileSystemObject对象!
在.Net中涉及此类操作的是System.IO
以下是程序代码 注:此代码非原创!参考别人代码
//生成HTML页
public static bool W ......
1.关闭不必要的Session
<%@ Page EnableSessionState="flase"%>
2.关闭不必要的ViewState
<asp:DataGrid EnableViewState="false" runat="server">
如果页面级
<%@ Page EnableViewState="false"%>
3.不要使用Exception控制程序流程
Exception是很耗资源的
4.禁用VB和JScript动态数 ......
效果图:
前台代码:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="OWCdrawing.aspx.cs" Inherits="OWCdrawing" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xh ......