Displaying panel between two radiobuttonlist listitems

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hsegoy1979
    New Member
    • Jun 2008
    • 30

    Displaying panel between two radiobuttonlist listitems

    Dear All
    Iam new to asp.net. I want to display a panel between two radio buttonlist
    listitems. I have wriiten in comments in code to display panel position.
    Here is my code

    Code:
    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="RadiobtnlistPanel.aspx.cs" Inherits="RadiobtnlistPanel" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
        <title>Untitled Page</title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            <table>
                <tr>
                    <td>
                    <p>
                        <asp:RadioButtonList ID="RadioButtonList1"  AutoPostBack="true" RepeatDirection="Vertical" runat="server" OnSelectedIndexChanged="RadioButtonList1_SelectedIndexChanged">
                         <asp:listitem Text="Panel1" Selected="True"></asp:listitem>
    
    //Panel1  should display here
    
                         <asp:ListItem Text="Panel2"></asp:ListItem>
    
    //Panel2 should display here
    
                        </asp:RadioButtonList>
                    </p>
                    <p>
                       <asp:Panel ID ="Panel1" runat="server">This is First Panel</asp:Panel>
                       <asp:Panel ID ="Panel2" runat="server" Visible="false">This is my second panel</asp:Panel>
                    </p>     
                    </td>
                </tr>
            </table>
        </div>
        </form>
    </body>
    </html>
    Regards
    Yogesh
  • kenobewan
    Recognized Expert Specialist
    • Dec 2006
    • 4871

    #2
    Although you are using asp.net objects this seems like a simple html problem.

    Comment

    • Frinavale
      Recognized Expert Expert
      • Oct 2006
      • 9749

      #3
      Have you tried putting panels there??

      eg:

      Code:
      <%@ Page Language="C#" AutoEventWireup="true" CodeFile="RadiobtnlistPanel.aspx.cs" Inherits="RadiobtnlistPanel" %>
      
      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      
      <html xmlns="http://www.w3.org/1999/xhtml" >
      <head runat="server">
          <title>Untitled Page</title>
      </head>
      <body>
          <form id="form1" runat="server">
          <div>
              <table>
                  <tr>
                      <td>
                      <p>
                          <asp:RadioButtonList ID="RadioButtonList1"  AutoPostBack="true" RepeatDirection="Vertical" runat="server" OnSelectedIndexChanged="RadioButtonList1_SelectedIndexChanged">
                           <asp:listitem Text="Panel1" Selected="True"></asp:listitem>
      
       <asp:Panel ID ="Panel1" runat="server">This is First Panel</asp:Panel>
                           <asp:ListItem Text="Panel2"></asp:ListItem>
      
                         <asp:Panel ID ="Panel2" runat="server" Visible="false">This is my second panel</asp:Panel>
                          </asp:RadioButtonList>
                      </p>
                      <p>
                        
      
                      </p>     
                      </td>
                  </tr>
              </table>
          </div>
          </form>
      </body>
      </html>

      Comment

      Working...