读书人

小弟我照入门经典创建个性化配置 做不

发布时间: 2011-12-23 23:32:01 作者: rapoo

我照入门经典创建个性化配置 做不出来
书上说先在 web.config文件里添加 如下代码
<connectionStrings/>

<system.web>
<!--
设置 compilation debug="true" 可将调试符号插入
已编译的页面中。但由于这会
影响性能,因此只在开发过程中将此值
设置为 true。
-->
<profile>
<properties>
<add name="Country"/>
<add name="Visits" type="System.Int32" defaultValue="0"/>
<add name="LastVisit" type="System.DateTime"/>
</properties>
</profile>
<compilation debug="false">

再创建一个WEB页面,添加三个标签,在load事件下面添加如下代码:
protected void Page_Load(object sender, EventArgs e)
{
LabelLastVisit.Text=Profile.lastVisit.ToLongTimestring();
LabelVisitCount.Text=Profile.Visite.Tostring();
labelSelectedCountry.Text=Profile.Country;

实际上以上的 Profile.的代码是我硬写上去的,输入时候,不会自己跳出来, 是不是我漏using 什么了,
书上没有介绍,请大家指点一下,谢谢.

[解决办法]
你没引用!
[解决办法]
没明白
[解决办法]
profile没引用命名空间,调试时不会出现“profile未定义”?
[解决办法]
没看明白

读书人网 >asp.net

热点推荐