网站导航免费论文 原创论文 论文搜索 原创论文 网学软件 学术大家 资料中心 会员中心 问题解答 原创论文 大学论文导航 设计下载 最新论文 下载排行 原创论文 论文源代码
返回网学首页
网学联系
最新论文 推荐专题 热门论文 素材专题
当前位置: 网学 > 编程文档 > ASP.net > 正文

MigratingfromASP.NET1.xtoASP.NET2.0

来源:http://myeducs.cn 联系QQ:点击这里给我发消息 作者: 用户投稿 来源: 网络 发布时间: 12/10/12
the controls to match the design of your application. The properties window lets you access the label, value, and error message validation elements for each property. By using the loginname and loginstatus controls, you can now give each user a personalized greeting as well as create login/logout functionality without writing any code.

the loginview control allows you to determine which content is displayed to the user, without writing a single line of code. The content is displayed by examining the status and role of each user to determine an appropriate view. In traditional ASP applications, you had to write code to identify the current user, additional code to validate the user''s status, and then even more code to display content based on the user.

for a more detailed description of Web parts, please read Personalization with ASP.NET 2.0.

Profiles

the ASP.NET 2.0 profile features allow you to define, save, and retrieve information associated with any user that visits your Web site. In a traditional ASP application, you would have to develop your own code to gather the data about the user, store it in session during the user''s session, and save it to some persistent data store when the user leaves the Web site. ASP.NET 2.0 automates all of this functionality with profiles. A profile is essentially a bucket of information associated with a user, and is directly accessible through the profile object that is accessible from every ASPX page.

Defining a Profile

within machine.config or Web.config, you can define a profile with <property> values that represent information such as name, billing address, and e-mail addresses for each user. You can even create groups of logical properties.

<profile>  <group name="BillingAddress">    <add name="Street" type="System.String" />    <add name="City" defaultValue="Toronto" type="System.String" />    <add name="StateProv" type="System.String" />    <add name="ZipPostal" type="System.String" />  </group></profile>

once you have defined the profile, ASP.NET and the profile provider automatically take care of managing this information, including loading it on request and storing it when the user leaves your site.

Using Profiles

once you have defined a profile, Visual Studio 2005 automatically exposes the profile properties through the profile object.

figure 15. Using profiles

visual Studio 2005 also provides full IntelliSense support for profiles. If you ever make a change to the profile definition, Visual Studio will automatically provide the correct IntelliSense as soon as you have saved your Web.config file.

Web Parts

one of the major differences between a Web application and a desktop application has been the ease with which a desktop application can contain multiple configurable components. For example, consider the Visual Studio IDE itself. A user can decide which windows to display and how they are arranged. Developing similar functionality in a Web site is a da

网学推荐

免费论文

原创论文

设为首页 | 加入收藏 | 论文首页 | 论文专题 | 设计下载 | 网学软件 | 论文模板 | 论文资源 | 程序设计 | 关于网学 | 站内搜索 | 网学留言 | 友情链接 | 资料中心
版权所有 QQ:3710167 邮箱:3710167@qq.com 网学网 [Myeducs.cn] 您电脑的分辨率是 像素
Copyright 2008-2015 myeducs.Cn www.myeducs.Cn All Rights Reserved 湘ICP备09003080号