• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 764
  • Last Modified:

Probles nesting ASP.net 2.0 Panels Controls

Hi

I am having problems nesting ASP.net Panels Controls, would be possible to do that?

Thanks in advance
CODE WITHOUT PROBLEMS:
 
<asp:Panel ID="pnTotales" runat="server">
            <table cellpadding="5">
              <tr>
                <td width="370" height="25" align="center" bordercolor="#FFFFFF" bgcolor="#FFFFFF">&nbsp;</td>
                <td width="99" height="25" align="right" bordercolor="#FFFFFF" bgcolor="#EBEAF2" class="LineaDeTotalesCarrito"><div align="right">SubTotal:</div></td>
                <td width="99" height="25" align="left" bordercolor="#FFFFFF" bgcolor="#EBEAF2" class="LineaDeTotalesCarrito"><div align="right">
                  <% =SubTotal.ToString("c")%>
                </div></td>
              </tr>
              <tr>
                <td width="370" height="25" align="center" bordercolor="#FFFFFF" bgcolor="#FFFFFF">&nbsp;</td>
                <td width="99" height="25" align="right" bordercolor="#FFFFFF" bgcolor="#EBEAF2" class="LineaDeTotalesCarrito"><div align="right">IVA:</div></td>
                <td width="99" height="25" align="left" bordercolor="#FFFFFF" bgcolor="#EBEAF2" class="LineaDeTotalesCarrito"><div align="right">
                  <% =IVA.ToString("c")%>
                </div></td>
              </tr>
	        <asp:Panel ID="pnDescuento" runat="server">
              <tr>
                <td width="370" height="25" align="center" bordercolor="#FFFFFF" bgcolor="#FFFFFF">&nbsp;</td>
                <td width="99" height="25" align="right" bordercolor="#FFFFFF" bgcolor="#EBEAF2" class="LineaDeTotalesCarrito"><div align="right">Descuento:</div></td>
                <td width="99" height="25" align="left" bordercolor="#FFFFFF" bgcolor="#EBEAF2" class="LineaDeTotalesCarrito"><div align="right">
                  <% =Descuento.ToString("c")%>
                </div></td>
              </tr>
	        </asp:Panel>			  
              <tr>
                <td width="370" height="25" align="center" bordercolor="#FFFFFF" bgcolor="#FFFFFF">&nbsp;</td>
                <td width="99" height="25" align="right" bordercolor="#FFFFFF" bgcolor="#EBEAF2" class="LineaDeTotalesCarrito"><div align="right">Total:</div></td>
                <td width="99" height="25" align="left" bordercolor="#FFFFFF" bgcolor="#EBEAF2" class="LineaDeTotalesCarrito"><div align="right">
                  <% =Total.ToString("c")%>
                </div></td>
              </tr>
              <tr>
                <td height="25" bordercolor="#FFFFFF" bgcolor="#FFFFFF"></td>
                <td height="25" colspan="2" align="center" bordercolor="#FFFFFF" class="LineaDeCondicionesCarrito">
 
                <asp:RadioButton ID="rbtnCondicionesCo" Text="Contado" TextAlign="left" runat="server" GroupName="Condiciones" />
                <asp:RadioButton ID="rbtnCondicionesCr" Text="Cr&eacute;dito" TextAlign="left" runat="server" GroupName="Condiciones" /></td>
 
              </tr>
              <tr>
                <td height="25" align="center" bordercolor="#FFFFFF" bgcolor="#FFFFFF">&nbsp;</td>
                <td height="25" colspan="2" align="center" bordercolor="#FFFFFF" class="LineaDeCondicionesCarrito">&nbsp;</td>
              </tr>
          </table>
 
        </asp:Panel>
 
CODE WITH EXTRA PANEL INSIDE:
 
        <asp:Panel ID="pnTotales" runat="server">
            <table cellpadding="5">
              <tr>
                <td width="370" height="25" align="center" bordercolor="#FFFFFF" bgcolor="#FFFFFF">&nbsp;</td>
                <td width="99" height="25" align="right" bordercolor="#FFFFFF" bgcolor="#EBEAF2" class="LineaDeTotalesCarrito"><div align="right">SubTotal:</div></td>
                <td width="99" height="25" align="left" bordercolor="#FFFFFF" bgcolor="#EBEAF2" class="LineaDeTotalesCarrito"><div align="right">
                  <% =SubTotal.ToString("c")%>
                </div></td>
              </tr>
              <tr>
                <td width="370" height="25" align="center" bordercolor="#FFFFFF" bgcolor="#FFFFFF">&nbsp;</td>
                <td width="99" height="25" align="right" bordercolor="#FFFFFF" bgcolor="#EBEAF2" class="LineaDeTotalesCarrito"><div align="right">IVA:</div></td>
                <td width="99" height="25" align="left" bordercolor="#FFFFFF" bgcolor="#EBEAF2" class="LineaDeTotalesCarrito"><div align="right">
                  <% =IVA.ToString("c")%>
                </div></td>
              </tr>
	        <asp:Panel ID="pnDescuento" runat="server">
              <tr>
                <td width="370" height="25" align="center" bordercolor="#FFFFFF" bgcolor="#FFFFFF">&nbsp;</td>
                <td width="99" height="25" align="right" bordercolor="#FFFFFF" bgcolor="#EBEAF2" class="LineaDeTotalesCarrito"><div align="right">Descuento:</div></td>
                <td width="99" height="25" align="left" bordercolor="#FFFFFF" bgcolor="#EBEAF2" class="LineaDeTotalesCarrito"><div align="right">
                  <% =Descuento.ToString("c")%>
                </div></td>
              </tr>
	        </asp:Panel>			  
              <tr>
                <td width="370" height="25" align="center" bordercolor="#FFFFFF" bgcolor="#FFFFFF">&nbsp;</td>
                <td width="99" height="25" align="right" bordercolor="#FFFFFF" bgcolor="#EBEAF2" class="LineaDeTotalesCarrito"><div align="right">Total:</div></td>
                <td width="99" height="25" align="left" bordercolor="#FFFFFF" bgcolor="#EBEAF2" class="LineaDeTotalesCarrito"><div align="right">
                  <% =Total.ToString("c")%>
                </div></td>
              </tr>
              <tr>
                <td height="25" bordercolor="#FFFFFF" bgcolor="#FFFFFF"></td>
                <td height="25" colspan="2" align="center" bordercolor="#FFFFFF" class="LineaDeCondicionesCarrito">
 
            <asp:Panel ID="pnCondiciones" runat="server">
                <asp:RadioButton ID="rbtnCondicionesCo" Text="Contado" TextAlign="left" runat="server" GroupName="Condiciones" />
                <asp:RadioButton ID="rbtnCondicionesCr" Text="Cr&eacute;dito" TextAlign="left" runat="server" GroupName="Condiciones" /></td>
            </asp:Panel>
 
              </tr>
              <tr>
                <td height="25" align="center" bordercolor="#FFFFFF" bgcolor="#FFFFFF">&nbsp;</td>
                <td height="25" colspan="2" align="center" bordercolor="#FFFFFF" class="LineaDeCondicionesCarrito">&nbsp;</td>
              </tr>
          </table>
 
        </asp:Panel>

Open in new window

0
dimensionav
Asked:
dimensionav
  • 2
  • 2
2 Solutions
 
David RobitailleAnalyst ProgrammerCommented:
It`s not that nesting of panel that causes problem, it`s the use of a table :
You cannot put Row in a panel; panel render as <div>
What are you trying to do?
ex: One thing you could do is assign a ID to a TR element.
 
0
 
dimensionavAuthor Commented:
davrob60:

The idea is to manage a "hidden" row which will contain a discount for special users, the web application will detect the "kind" of user and after that will (or not) enable the discount for it (the panel).

Thanks
0
 
David RobitailleAnalyst ProgrammerCommented:
0
 
dimensionavAuthor Commented:
I got it!
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now