Attributes.Add  怎么用。什么时候用。都什么属性啊

解决方案 »

  1.   

    There are two types of attribute:Content attributes are associated with item types and page types, and store information about an item or page, such as the associated category, description, or perspectives. These attributes are included in the add and edit screens where users can provide information about the item or page they are adding or editing. Page group administrators can create their own item types and page types and specify exactly what information they want users to supply by choosing which attributes to include. In addition, page group administrators can create their own attributes for containing extra information.Display attributes are associated with regions, and display information about an item or portlet, such as the author, display name, and creation date. Page designers can choose which attributes to display in a region. Note that some content attributes, such as author and description, are also display attributes. Any custom attributes created by the page group administrator can also be used as display attributes.Built-in content attributes:
    Attribute:          This attribute contains:
     
    Author              The name of the author of the item.
     
    Category            The name of the category to which the item or page belongs.
     
    Description         A short text description of the item or page.
     
    Display Name        The display name of the item or page.
     
    Display Option      Information about how the item or portlet should be displayed:
                                  Item Displayed Directly In Page Area 
                                  Link That Displays Item In Full Browser Window 
                                  Link That Displays Item In New Browser Window 
     
    Enable Item Check-Out
     Information about whether or not the item can be checked out and checked in. This provides document control, allowing groups of users to edit items and not overwrite each other's work. Users cannot edit items that are checked out by another user.
     
    Expiration Period
     Information about how long an item should be displayed on a page.
     
    Image
     The image associated with the item or page.
     
    Image Alignment
     Information about where the item image should appear in the page.See Item image alignment for a description and example of the different image alignment options.
     
    Keywords
     Keywords that describe the content or purpose of the item or page. When a user performs a search, the user's search criteria is compared to the keywords to find a match.
     
    Perspectives
     The names of the perspectives associated with the item or page.
     
    Publish Date
     The date (in the format, DD-MON-YYYY HH12:MI PM) when the item should start being displayed to users.
     
    Rollover Image
     The second image associated with the item or page. This image is displayed whenever a user moves the mouse cursor over the original image on a navigation bar or tab.
     
    Built-in display attributes
      

  2.   

    晕,估计高手们实在不屑于回答这个问题,我来说两句吧public System.Web.UI.AttributeCollection Attributes [  get]
        System.Web.UI.WebControls.WebControl 的成员摘要:
     获取与控件的属性不对应的任意特性(只用于呈现)的集合。呈现,就是前台页面中的东西了,比如以下代码,既有样式,也有js
    e.Item.Attributes.Add("style","cursor:pointer");
    e.Item.Attributes.Add("onclick","SelectName('"+e.Item.Cells[0].Text+"','"+e.Item.Cells[1].Text+"')");
    e.Item.Attributes.Add("onmouseover","this.oldcolor=this.style.backgroundColor;this.style.backgroundColor='#44A619'");
    e.Item.Attributes.Add("onmouseout","this.style.backgroundColor=this.oldcolor");
    e.Item.Attributes.Add("onclick","javascript:alert('"+e.Item.Cells[0].Text+"')");