gridview hyperlink

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • srinme
    New Member
    • Feb 2008
    • 3

    gridview hyperlink

    <asp:HyperLin k ID="hlkFilename " runat="server" NavigateUrl='<% #PopulatePath(E val("FullName") .ToString(),Eva l("Name").ToStr ing()) %>' target="_blank" ><%#Eval("Name" )%></asp:HyperLink>

    I am displaying a file name using this. i need to get the file name in codebehind (vb.net) to delete the particular file in gridview. I am not getting the values in grid view from database.they r from some folders. Can some one help me out in getting the file name in codebehind.

    I am trying like this but its not working



    Dim lnkName As HyperLink
    lnkName=ctype(g vAppSearch.rows[e.RowIndex].cells[1].FindControl("h lkFilename"),Hy perLink)
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    The ID property should be unique for each control, it rather looks like you would have the same name for each hyperlink. That would cause FindControl to fail. You would need to fix that to start with.

    Comment

    • srinme
      New Member
      • Feb 2008
      • 3

      #3
      I gave unique ID. But i am not able to get the name displayed in the hyperlink

      Comment

      • Plater
        Recognized Expert Expert
        • Apr 2007
        • 7872

        #4
        i think if you set the Text proeprty of the hyperlink to the filename, instead of putting it in between the tags it will return something?

        Comment

        Working...