Re: Dynamic table rows don't appear on client page - Any idea why

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hi Wiktor,

Thank you very much for responding to my plea for help. Subsequent to
posting my request, I received a response to a different request that turned
out to be related to this one. I turns out that I failed to change
AutoEventWireup="false" to "true". Once I did that, my table was rendered on
the client web page.

Nevertheless, I'm interested in learning alternative techniques, so I tried
switching from Table to Html table. However I ran into compilation problems:

1. MyTable.Rows.Add(r) was flagged because "CS1502: The best overloaded
method match for
'System.Web.UI.WebControls.TableRowCollection.Add(System.Web.UI.WebControls.TableRow)'
has some invalid arguments"

2. I tried switch MyTable's declaration from
"System.Web.UI.WebControls.Table " to
"System.Web.UI.HtmlControls.HtmlTable", but that led to an error in the
statement in the statement adding MyTable to the form: "The base class
includes the field 'MyTable', but its type
(System.Web.UI.HtmlControls.HtmlTable) is not compatible with the type of
control (System.Web.UI.WebControls.Table)"

I also noted that the HTML controls were not available in my Toolbox when I
was building this WebForm application. I wonder is an omen that we won't be
able to use any HTML controls in this context. Or is there a way I can make
them available?

Incidentally, I just found a C# example at
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwebuihtmlcontrolshtmltableclasstopic.asp,
which I'll study.

Again, thanks for your help.

Regards,

Richard


.



Relevant Pages