我(不幸的是)更新了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'
如何检索按钮所在的表格单元格?
答案 0 :(得分:1)
你必须施展它:
TableCell tblCell = (TableCell)button.Parent;