asp:table in formview not possible???


L

Leo Pape

Hello,

When I place a <asp:table> in a formview (In the edititemtemplate or
insertitemtemplate) I'm not able to update data anymore if the bound
controls are placed in that table
When I place the controls in a general html table it works fine

My code that dos not work:

<EditItemTemplate>

<asp:Table>

<asp:TableRow>

<asp:TableCell>



<asp:TextBox ID="TextBox1" runat="server" Text='<%#
Bind("Cnt_Contact") %>'></asp:TextBox>



</asp:TableCell>

</asp:TableRow>

</asp:Table>



<asp:Button ID="UpdateButton" ....



</EditItemTemplate>





My code that works fine:



<EditItemTemplate>

<table>

<tr>

<td>



<asp:TextBox ID="TextBox1" runat="server" Text='<%#
Bind("Cnt_Contact") %>'></asp:TextBox>



</td>

</tr>

</table>



<asp:Button ID="UpdateButton" ...



</EditItemTemplate>



Does anyone have an idea why it's not possible to place the bind controls
inside an asp:table?

I want to an asp:table because this table has the property skinId, and a
general html table doesnt support skins...



Leo Pape
 
Ad

Advertisements

Joined
Sep 26, 2006
Messages
1
Reaction score
0
Solution

Use tables that are not server-side. Don't use <asp:table> or <table runat=server>.

The UpdateMethod (and others) ignores controls hidden in serverside tables for some reason.

Took me two hours to figure this out...

Cheers,
Sire
sire_at_acc.umu.se
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top