2013-12-10 52 views
0

我是ASP和Ajax的新手,請使用Ajax Control Toolkit的Accordion Tool來顯示短和長的描述文本。如何使用.Net Ajax手風琴來顯示對長的簡短描述

感謝

+1

其實你嘗試過什麼?你能張貼你不明白的東西嗎?如果你說的新手,請參考:http://www.ajaxtutorials.com/controls/ajax-accordion-control-tutorial-asp-net-4-0/ – Sabilv

+0

我還沒有嘗試過任何東西。謝謝你的鏈接 – CodeNewbie

回答

0
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head runat="server"> 
    <title>Accordion Tutorial</title> 
    <style type="text/css"> 
     .accordion { 
      width: 400px; 
     } 

     .accordionHeader { 
      border: 1px solid #2F4F4F; 
      color: white; 
      background-color: #2E4d7B; 
      font-family: Arial, Sans-Serif; 
      font-size: 12px; 
      font-weight: bold; 
      padding: 5px; 
      margin-top: 5px; 
      cursor: pointer; 
     } 

     .accordionHeaderSelected { 
      border: 1px solid #2F4F4F; 
      color: white; 
      background-color: #5078B3; 
      font-family: Arial, Sans-Serif; 
      font-size: 12px; 
      font-weight: bold; 
      padding: 5px; 
      margin-top: 5px; 
      cursor: pointer; 
     } 

     .accordionContent { 
      background-color: #D3DEEF; 
      border: 1px dashed #2F4F4F; 
      border-top: none; 
      padding: 5px; 
      padding-top: 10px; 
     } 
    </style> 
</head> 
<body> 
    <form id="form1" runat="server"> 
     <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"></asp:ToolkitScriptManager> 
     <div> 
      <asp:Accordion ID="Accordion1" runat="server" 
       SelectedIndex="0" 
    HeaderCssClass="accordionHeader" 
    HeaderSelectedCssClass="accordionHeaderSelected" 
    ContentCssClass="accordionContent" 
    AutoSize="None" 
    FadeTransitions="true" 
    TransitionDuration="250" 
    FramesPerSecond="40" 
    RequireOpenedPane="false" 
    SuppressHeaderPostbacks="true" Height="367px" Width="540px"> 

    <Panes> 
    <asp:AccordionPane ID="AccordionPane1" runat="server"> 
     <Header>Pane 1</Header> 
     <Content> 
      This is pane 1 
     </Content> 
    </asp:AccordionPane> 
    <asp:AccordionPane ID="AccordionPane2" runat="server"> 
     <Header>Pane 2</Header> 
     <Content> 
      This is pane 2 
     </Content> 
    </asp:AccordionPane> 
    <asp:AccordionPane ID="AccordionPane3" runat="server"> 
     <Header>Pane 3</Header> 
     <Content> 
      This is pane 3 
     </Content> 
    </asp:AccordionPane> 
</Panes> 

     </asp:Accordion> 



     </div> 
    </form> 
</body> 
</html> 

能否請你去通過鏈接

http://www.ajaxtutorials.com/controls/ajax-accordion-control-tutorial-asp-net-4-0/

這是阿賈克斯 提供的文檔http://www.asp.net/ajaxlibrary/AjaxControlToolkitSampleSite/Accordion/Accordion.aspx

+0

雖然這可能在理論上回答這個問題,[這將是更可取的](http://meta.stackexchange.com/q/8259)在這裏包括答案的基本部分,並提供鏈接參考。 –