在Web.config中如此定义:
_____________________________________________________________________________
....
<profile enabled="true" >
<properties>
<add name="Country"/>
<add name="Visits" type="System.Int32" defaultValue="0"/>
<add name="LastVisit" type="System.DateTime"/>
</properties>
</profile>
</System.Web>
_________________________________________________________________________在ProfileDemo.aspx中如此使用:
_________________________________________________________________________
protected void Page_Load(object sender, EventArgs e)
{ //Label1.Text = HttpContext.Current.Profile.LastVisit.ToLongTimesString();
Label1.Text = Profile.LastVisit.ToLongTimesString();
}
}
__________________________________________________________________________
运行时出现如此问题:
Error 1 The name 'Profile' does not exist in the current context (红色部分就是了)
_____________________________________________________________________________
....
<profile enabled="true" >
<properties>
<add name="Country"/>
<add name="Visits" type="System.Int32" defaultValue="0"/>
<add name="LastVisit" type="System.DateTime"/>
</properties>
</profile>
</System.Web>
_________________________________________________________________________在ProfileDemo.aspx中如此使用:
_________________________________________________________________________
protected void Page_Load(object sender, EventArgs e)
{ //Label1.Text = HttpContext.Current.Profile.LastVisit.ToLongTimesString();
Label1.Text = Profile.LastVisit.ToLongTimesString();
}
}
__________________________________________________________________________
运行时出现如此问题:
Error 1 The name 'Profile' does not exist in the current context (红色部分就是了)
解决方案 »
- 求 一SQL语句
- windows服务部署的问题!!!
- 帮忙翻译一个java的函数成.net
- 寻找remoting源码和资料
- C# chart 控件如何改变大小
- 1分感谢谢兄弟。
- 提交给webform,请各位指点
- 我这样在dataGrid中嵌套一个日期下拉控件时会提示“未将对象引用设置到对象实例”?
- 添加一行数据时,CurrencyManager始终指向Position为0的位置。搞不定啦!!帮帮忙啦!!!
- c# 中如何与COM的Variant类型交互?
- 同一个解决方案中,项目A如何使用项目B中的类。二者的命名空间都相同,但是类之间却不能直接访问,如何解决?
- 求最高效的矢量数据 光栏法 压缩算法代码
然后
ConfigurationManager.xxx