0

I read files from Blob named 'pdf' and display in on the asp.net web form. Every file is read displayed in the ListView control. Each file is displayed one after another (side by side), instead of in a new line.

Each file is displayed by name with its hyperlink.

{
    pdfDisplayControl.DataSource = from o in 
     getfileGalleryContainer().GetDirectoryReference("pdf").ListBlobs()
                                       select new { Url = o.Uri };
    pdfDisplayControl.DataBind();

    }

........................................

{
<asp:ListView ID="pdfDisplayControl" runat="server">
<LayoutTemplate>
 <asp:Hyperlink ID="itemPlaceholder" runat="server" />
 </LayoutTemplate>
 <ItemTemplate>
 <asp:Hyperlink ID="pdfhyperlink" Text ='<%# 
  System.IO.Path.GetFileName(Eval("Url").ToString()) %>' runat="server" 
  NavigateUrl='<%# Eval("Url") %>' /> 
  </ItemTemplate>
   </asp:ListView>
  }

All files are displayed as follows:

file1.pdf file2.pdf file3.pdf.

But I want to display as follows:

file1.pdf.
file2.pdf
file3.pdf.

Any idea please?

1 Answer 1

1

just add a css style of display:block to your hyperlink:

 <asp:Hyperlink style="display:block" ID="pdfhyperlink" Text ='<%# 
  System.IO.Path.GetFileName(Eval("Url").ToString()) %>' runat="server" 
  NavigateUrl='<%# Eval("Url") %>' />
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.