2013-10-08 23 views
1

即時通訊使用asp控件。 我需要該RadioButton控件將包含一個文本框控件。 我試圖這樣做 - 但那是不可能的...帶有文本框和隱藏div的放射按鈕列表(帶有示例圖像)

我怎樣才能得到與此圖像類似的結果? 圖像顯示例如,對於radionbutton和文本框

https://docs.google.com/file/d/0B7CLNmjk_GPpTkEtRUFBTzh5Rlk/edit?usp=sharing

點擊+將打開「添加圖片」選項...

到目前爲止,這是單選按鈕列表

<asp:RadioButtonList ID="RBList" runat="server"> 
        <asp:ListItem Value="1"></asp:ListItem> 
        <asp:ListItem Value="2"></asp:ListItem> 
        <asp:ListItem Value="3"></asp:ListItem> 
        <asp:ListItem Value="4"></asp:ListItem> 
       </asp:RadioButtonList> 
+0

單選按鈕不能「包含」一個文本框,它與文本框很簡單相關。另外,什麼是「添加圖像」? 另外,你可以包含不起作用的代碼嗎? 另外,你到目前爲止嘗試過什麼? – CharlesAD

+0

有沒有代碼...只是一個單選按鈕列表 - 我不知道如何使它看起來像在例子... – user2828251

+0

你必須添加一個接一個的元素。它不是一個特殊的控制,這個例子只是一個控件的繼承,就像任何網站一樣... – CharlesAD

回答

0

如果您需要動態綁定這些控件,您可以嘗試使用中繼器:

<asp:Repeater ID="Repeater1" runat="server" > 
      <HeaderTemplate> 
       <table> 
       <tr> 
       <th>radiobuttons</th> 
       <th>textboxes</th> 
       </tr> 
      </HeaderTemplate> 
      <ItemTemplate> 
      <tr> 
       <td> 
        <asp:RadioButton runat="server" /> 
       </td> 
       <td> 
        <asp:Textbox runat="server" width="200px" /> 
       </td> 
      </tr> 
      </ItemTemplate> 
      <FooterTemplate> 
       </table> 
      </FooterTemplate> 
</asp:Repeater> 

否則,如果你需要一個定義的元素的數量,只使用靜態聲明(你也可以使用,而不是表的濫用CSS):

<table> 
    <tr> 
     <th>radiobuttons</th> 
     <th>textboxes</th> 
    </tr> 
    <tr> 
     <td> 
      <asp:RadioButton runat="server" /> 
     </td> 
     <td> 
      <asp:Textbox runat="server" width="200px" /> 
     </td> 
    </tr> 
    <tr> 
     <td> 
      <asp:RadioButton runat="server" /> 
     </td> 
     <td> 
      <asp:Textbox runat="server" width="200px" /> 
     </td> 
    </tr> 
    <tr> 
     <td> 
      <asp:RadioButton runat="server" /> 
     </td> 
     <td> 
      <asp:Textbox runat="server" width="200px" /> 
     </td> 
    </tr> 
</table>