【问题标题】:Quickwatch to C# code conversionQuickwatch 到 C# 代码转换
【发布时间】:2017-12-11 18:00:01
【问题描述】:

我必须通过快速手表找到一个价值,这就是我从中得到的:

((System.Web.UI.WebControls.TextBox)(new System.Linq.SystemCore_EnumerableDebugView(GvAllCustomers.SelectedRow.Cells[1].Controls).Items[0])).Text

GvAllCustomers 是我的网格视图

问题是,当我将它添加到我的代码中时,它会显示错误。

string sC_Name = ((System.Web.UI.WebControls.TextBox)(new System.Linq.SystemCore_EnumerableDebugView(GvAllCustomers.SelectedRow.Cells[1].Controls).Items[0])).Text;

错误 CS0234:命名空间“System.Linq”中不存在类型或命名空间名称“SystemCore_EnumerableDebugView”(您是否缺少程序集引用?)

我知道SystemCore_EnumerableDebugView 不在System.Linq 中。但是我应该用什么来代替它呢?

【问题讨论】:

标签: c# asp.net linq


【解决方案1】:

您不应该使用内部框架类,而应该依赖公共 api...

var textbox = grid.SelectedRow.Cells[1].Controls[0] as TextBox;

【讨论】:

  • 谢谢!这对我有帮助!
猜你喜欢
  • 1970-01-01
  • 2013-08-24
  • 2014-12-30
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多