mardi 28 avril 2015

Why doesn't the hyperlink open the file?

Earlier developer had put this code using a label and it was turned into a hyperlink during the run time.

<asp:Label ID="lbl_Attachment" runat="server">

lbl_Attachment.Text = "<a href='../Uploads/" + 
                      ds_row["Attachment"].ToString() + "'>" + 
                      ds_row["Attachment"].ToString() + "</a>";

But this is not working. So I changed the code to the following to open the any file (image/pdf/word) in a new browser tab and the error persists:

      hyperlinkAppDoc.NavigateUrl = 
          ResolveUrl("../Uploads/" + 
      hyperlinkAppDoc.Target = "_blank";  

enter image description here

What can I do to fix this issue? MIME types are available in the IIS.

Aucun commentaire:

Enregistrer un commentaire