什么是Webprofile有用? [英] What is Webprofile useful for?

查看:242
本文介绍了什么是Webprofile有用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我偶然发现了这个项目的 ASP.NET WebProfile发电机

I stumbled upon this project ASP.NET WebProfile Generator

为什么我需要代理类访问配置文件?

Why would I need proxy class to access profile?

推荐答案

由于ASP.NET只支持配置文件外的开箱即用的网站选项。如果您正在使用Web应用程序项目(WAP),那么你必须推出自己的。

Because ASP.NET only supports Profiles out-of-the-box with the Web Site option. If you are using a Web Application Project (WAP), then you have to roll your own.

问题来源于这样的事实是,Web应用程序项目不具备Profile对象自动添加到每一个页面的网站项目,所以我们不能让在我们的网站定义配置文件属性强类型的编程访问。配置文件。

The problem stems from the fact that the Web Application Project does not have the Profile object automatically added to each page as with the Web Site project, so we cannot get strongly-typed programmatic access to the profile properties defined in our web.config file.

好消息是,这是非常可行的:

Good news is that it's very doable:

  • ASP.NET: Web Site versus Web Application Project
  • How to add a Login, Roles and Profile system to an ASP.NET 2.0 app in only 24 lines of code
  • Web Profile Builder
  • Web Profile Builder for Web Application Projects
  • Writing a custom ASP.NET Profile class
  • ASP.NET Profiles in Web Application Projects

这篇关于什么是Webprofile有用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆