views:

92

answers:

2

According to the new 4.0 framework overview, one should be able to add the attribute RenderOuterTable="false" to a control that supports the attribute and see CSS friendly code be spit out - in other words no HTML tables.

To test this, I threw a login control into a basic fresh webpage with the following code:

<asp:Login ID="Login1" runat="server" RenderOuterTable="false"></asp:Login>

The result? Crappy HTML table output, which supposedly doesn't happen with this attribute set to false. Here is the output:

<table cellpadding="0"> <tr> <td align="center" colspan="2">Log In</td> </tr><tr> <td align="right"><label for="MainContent_Login1_UserName">User Name:</label></td><td><input name="ctl00$MainContent$Login1$UserName" type="text" id="MainContent_Login1_UserName" /><span id="MainContent_Login1_UserNameRequired" title="User Name is required." style="visibility:hidden;">*</span></td>...

Hopefully you get the point. How can these controls be stopped from outputting tables? This is super annoying.

A: 

It doesn't say that it will get rid of all tables, just that it will get rid of the extra outer table that was used to apply styles. Try getting rid of the property and note the extra table that wraps the one you quoted above.

bwarner
OK, propery not there. The page is the simplest aspx page you can get. The only thing in body is form, div and login control. No tables anywhere.
Mario
Oh, and I didn't mention. Still same output. Tons of HTML tables.
Mario
That was my point. The property does remove the outer table, just like its name implies, but it doesn't change anything else. Looks like SimonF has a suggestion if you really want to get rid of the tables completely.
bwarner
+1  A: 

Convert the Login control to a template. It will give you full control of the layout without a table in sight (including the outer table which previously got generated even if you used the template option).

SimonF
Converting it to a template works. When you convert, it just throws all the separate controls into the page, along with all the html tables. Thanks!
Mario