在数据列表中获取链接按钮的文本 [英] To get text of a linkbutton inside a datalist
本文介绍了在数据列表中获取链接按钮的文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
现在我正在使用asp.net.我正在做一个项目,就像一个搜索引擎.个性化的搜索引擎.因此,我必须将结果显示在数据列表中,作为锚文本,简短说明和URL.该锚文本显示在链接按钮中.单击锚文本时,我必须转到相应的网页.为此,我需要获取该linkbutton的文本.我如何获得该文本?
请回答..
Hi,
Now i am working with asp.net. I am doing a project, something like a search engine; a personalized search engine. So i have to display result in a datalist as an anchor text, a brief description, and URL. This anchor text is displayed in a linkbutton. When clicking the anchor text, i have to go to the corresponding web page. For that, i need to get the text of that linkbutton. How can i get that text??
Please do reply..
推荐答案
只需在ItemData绑定中找到控件,然后您就可以轻松获取Text.
LinkButton lb = (LinkButton )e.Item.FindControl("IdofLinkButton");
Just Find Control in ItemData Bound and then you easily get Text .
LinkButton lb = (LinkButton )e.Item.FindControl("IdofLinkButton");
这篇关于在数据列表中获取链接按钮的文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文