Tag: boundfield

从DetailsView获取BoundField的值

我似乎总是遇到这个问题。 我在View外面有一个按钮,它调用一个需要OrderNumber的函数。 我一直收到错误, ArgumentOutOfRangeException was unhandled by user code 在调试模式下,或在浏览器中这个, Specified argument was out of the range of valid values. 这就是我访问它的方式: string sOrderNumber = (Order_DetailsView.Rows[0].Cells[0].Controls[0] as TextBox).Text; int orderNumber = Int32.Parse(sOrderNumber); 我也试过((TextBox)Order_DetailsView.Rows[0].Cells[0].Controls[0]).Text和Rows[i].Cells[i].Controls[i]每个索引组合我可以理解。 这是DetailsView: 我只是这样做错了吗? 我看过那些我能找到的每个例子,我的代码看起来是合法的。 我觉得必须有一些我忽略的简单事物。

如何在gridview c#asp.net中添加超链接到boundfield

我在aspx页面中有一个gridview,我需要它在用户点击Component1值后从BoundField添加到Component的超链接。 如何将超链接添加到与BoundField相关的boundfield?