CommunityServer::Chameleon rocks - Asp.Net without aspx.cs!

Code tells:

1, you controls every char of output:

<CSControl:UserData ContainerId="WrapperID" Tag="H2" CssClass="WrapperClass"
    Property
="DisplayName" LinkTo="Profile" unrecognized="true">
   <LeaderTemplate>
      I'm a moderator and my 
<u>name</u> is
   
</LeaderTemplate>
   
<TrailerTemplate>
      .  So there!
   
</TrailerTemplate>
</CSControl:UserData>

outputs:

<h2 class="WrapperClass" id="WrapperID" unrecognized="true">I'm a moderator and my <u>name</u> is
<href="http://getben.com/user/Profile.aspx?UserID=2108">Ben Tiedt</a>.  So there!</h2>

2, data on demand

<CSControl:UserList runat="server" ShowHeaderFooterOnNone="false">

   
<QueryOverrides QueryType="ActiveUsers" SortBy="RecentPosts" SortOrder="Descending" PageSize="10" />

   
<HeaderTemplate>
      
<ol>
   
</HeaderTemplate>
   
<ItemTemplate>
      
<CSControl:UserData Property="DisplayName" runat="server" Tag="LI" LinkTo="PostsSearch" />
   
</ItemTemplate>
   
<NoneTemplate>
      There are no active users!
   
</NoneTemplate>
   
<FooterTemplate>
      
</ol>
   
</FooterTemplate>
</CSControl:UserList>

3, implicit, contextual data binding

<CSForum:ForumPostList runat="server">
   
<QueryOverrides SortBy="SortOrder" PagerID="Pager" PageSize="40" />
   
<HeaderTemplate>
      
<ul>
   
</HeaderTemplate>
   
<ItemTemplate>
      
<li>
         
<CSForum:ForumPostData Property="Subject" runat="server" />
         by
         
<CSControl:UserData Property="DisplayName" LinkTo="Profile" runat="server" />
      
</li>
   
</ItemTemplate>
   
<FooterTemplate>
      
</ul>
   
</FooterTemplate>
</CSForum:ForumPostList>
<CSControl:Pager runat="server" id="Pager" />

quote:
  • A UserData control rendered within a SectionList control would display data related to the first owner user of each Section (if at least one owner exists for the section; similarly, a UserList control would list all owners of the Section)
  • A UserData control rendered within a PostList control would display data related to the author of each post
4, build forms your way:
<CSBlog:ContactForm runat="server" SubjectTextBoxId="Subject" NameTextBoxId="Name"
    EmailTextBoxId
="Email" MessageTextBoxId="Body" SubmitButtonId="Submit">

   
<SuccessActions>
      
<CSControl:SetVisibilityAction runat="server" ControlIdsToShow="SuccessMessage" />
   
</SuccessActions>

   
<FormTemplate>
      
<div>
        <
CSControl:FormLabel LabelForId="Name" runat="server" ResourceName="Weblog_ContactForm_Name" />
        </
div>
      
<div><asp:TextBox id="Name" runat="server" /></div>
      
<div>
    <
CSControl:FormLabel LabelForId="Email" runat="server" ResourceName="Weblog_ContactForm_Email" />
        </
div>
      
<div><asp:TextBox id="Email" runat="server" /></div>
      
<div>
<
CSControl:FormLabel LabelForId="Subject" runat="server" ResourceName="Weblog_ContactForm_Subject" />
        </
div>
      
<div><asp:TextBox id="Subject" runat="server" /></div>        
      
<div>
<
CSControl:FormLabel LabelForId="Body" runat="server" ResourceName="Weblog_ContactForm_Body" />
        </
div>
      
<div><asp:TextBox id="Body" runat="server" TextMode="MultiLine" /></div>
      
<div>
      
<asp:Button id="Submit" runat="server" Text="Send" />
      
<CSControl:ResourceControl runat="Server" id="SuccessMessage"
            ResourceName
="Weblog_ContactForm_Sent" Visible="false" />
      
</div>
   
</FormTemplate>
</CSBlog:ContactForm>

5, conditional view:
<CSBlog:WeblogPostData Text="{0} comment(s)" Property="Replies" LinkTo="PostComments" runat="server">
   
<DisplayConditions>
      
<CSBlog:WeblogPostPropertyValueComparison runat="server" ComparisonProperty="Replies"
            ComparisonValue
="0" Operator="GreaterThan" />
   
</DisplayConditions>
</CSBlog:WeblogPostData>
<CSBlog:WeblogPostData Text="no comments" LinkTo="PostComments" runat="server">
   
<DisplayConditions>
      
<CSBlog:WeblogPostPropertyValueComparison runat="server" ComparisonProperty="Replies"
            ComparisonValue
="0" Operator="LessThanOrEqualTo" />
   
</DisplayConditions>
</CSBlog:WeblogPostData>

6, act as you want:
<SuccessActions>
   
<CSControl:GoToReferralUrlAction runat="server" />
   
<CSControl:SetVisibilityAction runat="server" ControlIdsToShow="SuccessMessage" />
</SuccessActions>

posted on 2007-03-13 03:21  deerchao  阅读(622)  评论(1编辑  收藏  举报