0

我有这个 gridview,我想使用这个 gridview 中的信息,但我不想在页面上显示它。所以我设置: grid.Visible = false,但现在出现“未定义网格”错误。如果grid.Visible = true,一切正常。我有一个检查这个的javascript函数:if (typeof (grid) !== "undefined"),但我的网格没有定义。有什么问题,我该如何解决?

4

1 回答 1

1

It is not rendered. With grid.Visible you control the rendering. Look at your HTML code. You will see, there is no code for the GridView if you set grid.Visible = false.

To hide it, use CSS instead: display: none:

grid.Style.Add("display", "none"); // not tested
于 2013-03-29T10:32:24.770 回答