ASP.NET Tutorial/Configuration/Profile — различия между версиями

Материал из .Net Framework эксперт
Перейти к: навигация, поиск
м (1 версия)
 
(нет различий)

Версия 18:30, 26 мая 2010

Creating personalization properties in the web.config file

   <source lang="csharp">

<configuration>

 <system.web>
   
    <profile>
   
     <properties>
   
       <add name="FirstName" />
       <add name="LastName" />
       <add name="LastVisited" />
       <add name="Age" />
       <add name="Member" />
   
    </properties>
   
  </profile>
   
  <authentication mode="Windows" />
   
   </system.web>

</configuration></source>


Defining types for personalization properties

   <source lang="csharp">

<configuration>

 <system.web>
    <profile>
       <properties>
           
          <add name="FirstName" type="System.String" />
          <add name="LastName" type="System.String" />
          <add name="LastVisited" type="System.DateTime" />
          <add name="Age" type="System.Integer" />
          <add name="Member" type="System.Boolean" />
           
       </properties>
   </profile>
   <authentication mode="Windows" />
 </system.web>

</configuration></source>


The Profile is defined in the web configuration file

   <source lang="csharp">

<configuration>

 <system.web>
   <profile>
     <properties>
       <add
         name="MasterPageFile"
         defaultValue="Dynamic1.master" />
     </properties>
   </profile>
 </system.web>

</configuration></source>