Click here to Skip to main content
15,915,076 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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...

Thanks in advance for any advice....
Posted
Comments
demouser743 10-Oct-10 0:42am    
What do you mean by text . What exactly you need please mention.
Ajith80301 10-Oct-10 10:04am    
I am displaying the url in the linkbutton. I need that url to go to that particular web page. I meant that by text.

1 solution

Take a datalist .
Add a templete field
then drag a linkbutton into it.

code....



XML
<asp:DataList runat="server" id="dlTitles"
       OnItemCommand="dlTitles_ItemCommand">
    <ItemTemplate>
      <b>Title:</b> <%# DataBinder.Eval(Container.DataItem, "title") %>
      <br />
      [<asp:LinkButton runat="server" id="btnDetails"
           Text="View Book Details" CommandName="Details" />]
    </ItemTemplate>
    <SeparatorTemplate>
      <hr>
    </SeparatorTemplate>
  </asp:DataList>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900