Interesting!
I was under the impression we were talking of HTML Table
Tags ! Sorry for the confusion.
I did look into it and yes there was no way to access the
controls!!It only allows us to add the Table Events in
Designer View...
I tried to add rows/cols programatically and it worked !
So I did some research and this is what MSDN say on the
Table Control ..
****
The Table control allows you to build an HTML table and
specify its characteristics in a straightforward manner. A
table can be built at design time given some static
content, but the power of a Table Web server control is
often realized when the table is built programmatically
with dynamic contents.
****
Source :
http://msdn.microsoft.com/library/default.asp?
url=/library/en-
us/cpref/html/frlrfsystemwebuiwebcontrolstablememberstopic.
asp
As mentioned above Table Control is more powerful when it
is built programatically.
This is wat I did ... I placed a Table control in the form
and then programatically added rows/cols and a Button
Control ! I was able to write a Click Event for the button
control and associate the Event with the Button and was
able to access it and it did work!
Here is a gist of wat I did,
private void Page_Load(object sender, System.EventArgs e)
{
TrTest = new TableRow();
TcTest = new TableCell();
btnTest = new Button();
TcTest.Controls.Add(btnTest);
TrTest.Cells.Add(TcTest);
TblTest.Rows.Add(TrTest);
btnTest.ID = "Test";
btnTest.Text = "Test Button";
btnTest.Click += new System.EventHandler
(this.btnTest_Click);
}
private void btnTest_Click(object sender,System.EventArgs
e)
{
Response.Write("It Works!");
}
HTH
Thanks,
-Shan
-----Original Message-----
here an example what i mean
<asp:table runat=server>
<asp:tablerow runat="server">
<asp:tablecell runat="server">
<asp:linkbutton runat=server
id=lbTest>Test</asp:linkbutton></asp:tablecell>
</asp:tablerow>
</asp:table>
now try to add the event to the linkbutton using the
Visual Designer :-)when I try to click the button, it activates the table
and adds the eventsfor the tables ... but how can i access that button? :-)
.