I’m trying to create a table with Listview and one of the fields I’m using is supposed to show a hyperlink to a more detailed view of the data shown, how I want to do that is by using FindControl on the ID of that item and then changing the value into a hyperlink of the detailed view page with a querystring attached, the problem is that I have no idea how to re-insert that data back into the listview field, which looks something like this:
<ItemTemplate>
<td>
<asp:Label ID="ViewLinkLabel" runat="server"
Text='[insert Link Here]' />
</td>
</ItemTemplate>
Please bear in mind that I’m still an amateur in ASP.net, and if any of this seems too convoluted when there’s a much easier to do this that I don’t know about.
Thank you
I dont have enough reputation to leave comments or edit posts but the code sample in Richard Harrison’s post has some problems:
Ideally you should also check if ViewLinkLabel is null before you use it.
Also this is presuming that the ViewLinkLabel control is a HyperLink but in the question this is actually a Label control.