如何获取为 ASP.NET 中的 BoundField 生成的控件的 ClientID?
我有一个包含 BoundFields 的表单,我需要获取与表单中每个 BoundField 关联的控件的 ClientID。 我该怎么做呢?
UPD:我没有控制 ID。我所拥有的只是绑定字段,不能有 id。
UPD2:我正在尝试编写这样的代码:
public IDictionary<BoundField, string> GetCliendIDs(FormView formView)
{
// How to find Client IDs for controls which were created for BoundFields
}
I have a form with BoundFields in it and I need to get ClientID(s) for control(s) associated with each BoundField I have in the form.
How can I do it?
UPD: I do not have control id. All I have is bound field which can not have an id.
UPD2: I'm trying to write a code like this:
public IDictionary<BoundField, string> GetCliendIDs(FormView formView)
{
// How to find Client IDs for controls which were created for BoundFields
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
试试这个:
其中“yourcontrol”是表单中控件的 id。您可以通过在源代码模式下打开aspx页面并查看该控件的ID值来找到该值。
此外,如果您知道绑定字段在表单控件中的位置,则可以访问它们,例如:
Try this:
Where "yourcontrol" is the id of the control in your form. You can find this value by opening the aspx page in source mode and look at the ID value of the control.
Also, you could access the boundfield if you know the location of them in the form control, example: