Gridview ButtonField 获取Gridview中ButtonField的text属性

软件发布|下载排行|最新软件

当前位置:首页IT学院IT技术

Gridview ButtonField 获取Gridview中ButtonField的text属性

  2021-03-19 我要评论
想了解获取Gridview中ButtonField的text属性的相关内容吗,在本文为您仔细讲解Gridview ButtonField的相关知识和一些Code实例,欢迎阅读和指正,我们先划重点:Gridview,ButtonField,text,下面大家一起来学习吧。

<asp:BoundField>用cell[2].text取到值。但<asp:HyperLinkField>和<asp:ButtonField>通过cell[0].Text和cell[13].Text取的值都是""。应如何取到值呢?

首先将ButtonField按钮的连接改为Button模式,然后就可以通过以下语句得到text值
Response.Write(((HyperLink)e.Row.Cells[0].Controls[0]).Text);

Response.Write((Button)BStationGridView.Rows[RowIndex].Cells[13].Controls[0]).Text);

Copyright 2022 版权所有 软件发布 访问手机版

声明:所有软件和文章来自软件开发商或者作者 如有异议 请与本站联系 联系我们