如何检索包含按钮的单元格?

时间:2014-02-14 15:20:22

标签: c# asp.net dotnetnuke-module dotnetnuke-5

我(不幸的是)更新了DotNetNuke 5桌面模块

我有一个按钮处理程序:

protected void ButtonHandler(object sender, EventArgs e)
{
    Button button = (Button)sender;
    TableCell tblCell = button.Parent;
}

我也尝试使用NamingContainer进行上述操作 - 但是这两个选项都向我抛出了这个错误:

Cannot implicitly convert type 'System.Web.UI.Control' to 'System.Web.UI.WebControls.TableCell'

如何检索按钮所在的表格单元格?

1 个答案:

答案 0 :(得分:1)

你必须施展它:

TableCell tblCell = (TableCell)button.Parent;