locked
File Link RRS feed

  • Question

  • User-1499457942 posted

    Hi

      In a datatable i have 3 fields ID , Name , Image. I want to display FileName as a link . FileName  are stored in a format like this

    ID_Name_FileName . 

    Thanks

    Saturday, June 23, 2018 5:39 PM

All replies

  • User-1171043462 posted

    Where and how you want to display link?

    Saturday, June 23, 2018 7:27 PM
  • User-1716253493 posted

    Try this

    <asp:HyperLink ID="HyperLink1" runat="server" 
    NavigateUrl='<%# Eval("filename", "~/folder/{0}") %>' 
    Text='<%# Eval("id", "{0}_") + Eval("name", "{0}_") + Eval("filename") %>' >
    </asp:HyperLink>

    Saturday, June 23, 2018 10:39 PM
  • User283571144 posted

    Hi JagjitSingh,

    According to your description, I couldn't understand clearly about requirement.

    Could you please tell me which column is the filename? 

    Do you mean the name column is the filname and its format is the "ID_Name_FileName"?

    Do you mean you want to show the hyper link as below format?

    ID_Name_FileName(the url of this file)

    Best Regards,

    Brando

    Monday, June 25, 2018 9:38 AM