We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you a podcast all about Citrix Workspace, moving to the cloud, and analytics & intelligence. Episode 2 coming soon!Listen Now

x

Probles nesting ASP.net 2.0 Panels Controls

dimensionav
dimensionav asked
on
Medium Priority
787 Views
Last Modified: 2012-05-06
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

Comment
Watch Question

Analyst Programmer
Commented:
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.
 

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Author

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
David RobitailleAnalyst Programmer
Commented:

Author

Commented:
I got it!
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.