从 ProfileBase 类继承

    创建自定义配置文件,可以在应用程序的 Web.config 文件中的 profile 配置元素的 inherits 属性中指定。
    Web.config总的设置:
    <profile inherits="EmployeeProfile">   
    </profile>。

None.gif using  System;
None.gif
using  System.Web.Profile;
None.gif
None.gif
namespace  Samples.AspNet.Profile
ExpandedBlockStart.gifContractedBlock.gif
dot.gif {
InBlock.gif  
public class EmployeeProfile : ProfileBase
ExpandedSubBlockStart.gifContractedSubBlock.gif  
dot.gif{
InBlock.gif    [SettingsAllowAnonymous(
false)]
InBlock.gif    [ProfileProvider(
"EmployeeInfoProvider")]
InBlock.gif    
public string Department
ExpandedSubBlockStart.gifContractedSubBlock.gif    
dot.gif{
ExpandedSubBlockStart.gifContractedSubBlock.gif      
get dot.gifreturn base["EmployeeDepartment"].ToString(); }
ExpandedSubBlockStart.gifContractedSubBlock.gif      
set dot.gifbase["EmployeeDepartment"= value; }
ExpandedSubBlockEnd.gif    }

InBlock.gif
InBlock.gif    [SettingsAllowAnonymous(
false)]
InBlock.gif    [ProfileProvider(
"EmployeeInfoProvider")]
InBlock.gif    
public EmployeeInfo Details
ExpandedSubBlockStart.gifContractedSubBlock.gif    
dot.gif{
ExpandedSubBlockStart.gifContractedSubBlock.gif      
get dot.gifreturn (EmployeeInfo)base["EmployeeInfo"]; }
ExpandedSubBlockStart.gifContractedSubBlock.gif      
set dot.gifbase["EmployeeInfo"= value; }
ExpandedSubBlockEnd.gif    }

InBlock.gif
ExpandedSubBlockEnd.gif  }

InBlock.gif
InBlock.gif  
public class EmployeeInfo
ExpandedSubBlockStart.gifContractedSubBlock.gif  
dot.gif{
InBlock.gif    
public string Name;
InBlock.gif    
public string Address;
InBlock.gif    
public string Phone;
InBlock.gif    
public string EmergencyContactName;
InBlock.gif    
public string EmergencyContactAddress;
InBlock.gif    
public string EmergencyContactPhone;
ExpandedSubBlockEnd.gif  }

ExpandedBlockEnd.gif}

转载于:https://www.cnblogs.com/hide0511/archive/2006/10/25/539690.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值