0

When I try and pull my metadata from the blob, it does not show at all. Currently I can upload an audio file, however, I cannot get it to display. The audio file is stored on Azure as blobs in the "PhotoGallery" container under "songsnippets"

Using web forms is new to me, usually, I would use MVC but my education requires this to be used.

Code for view -

<form id="form1" runat="server">
        <asp:ScriptManager ID="sm1" runat="server" />
        <div>
            Upload Song:
            <asp:FileUpload ID="upload" runat="server" />
            <asp:Button ID="submitButton" runat="server" Text="Submit" OnClick="submitButton_Click" />
        </div>
        <div>
            <asp:UpdatePanel ID="up1" runat="server">
                <ContentTemplate>
                    <asp:ListView ID="ThumbnailDisplayControl" runat="server">
                        <ItemTemplate>
                               <audio src='<%# Eval("Url") %>' controls="" preload="none"></audio>
                               <asp:Literal ID="label" Text='<%# Eval("Title") %>' runat="server"/>
                        </ItemTemplate>
                    </asp:ListView>
                    <asp:Timer ID="timer1" runat="server" Interval="1000" />
                </ContentTemplate>
            </asp:UpdatePanel>
        </div>
    </form>

Code behind PagePre render method -

ThumbnailDisplayControl.DataSource = from o in getPhotoGalleryContainer().GetDirectoryReference("songsnippet").ListBlobs()
                                                     select new { Url = o.Uri };


                ThumbnailDisplayControl.DataBind();
Andre Queen
  • 223
  • 4
  • 16
  • Please check the ACL for your blob container. It should not be `Private`. – Gaurav Mantri Oct 23 '17 at 11:56
  • @GauravMantri Checked, it is not private. Had this previously working for images however cannot seem to get audio displaying – Andre Queen Oct 23 '17 at 12:03
  • I would recommend you use [Azure Storage Explorer](https://learn.microsoft.com/en-us/azure/vs-azure-tools-storage-manage-with-storage-explorer) and copy your audio url and visit it via the browser to check this issue. Also, you could press F12 and inspect your web page when visiting it and check the audio source url, then you could compare it with the url you copied from azure storage explorer to narrow this issue. I assumed that there be space or other character within your blob name, you could update your question with the format of your audio blob file. – Bruce Chen Oct 24 '17 at 03:18

1 Answers1

1

When I try and pull my metadata from the blob, it does not show at all. Currently I can upload an audio file, however, I cannot get it to display.

Based on the code in your ASP.NET server page, I assumed that you upload the audio file when click the submitButton button, and you use the Timer control to enable partial-page updates at a defined interval and update the audio file list within the ThumbnailDisplayControl.

Per my understanding, you need to specific the OnTick for your timer1, and within the related timer1_Tick event, you need to get your latest audio files under your azure container and bind to the ThumbnailDisplayControl control, then when you access the page and press F12, you would see the ajax request send to your backend every second and update your ListView. For more details about Timer control, you could refer to here.

enter image description here

Moreover, you could leverage Azure Storage Explorer to check your uploaded audio files.

Bruce Chen
  • 18,207
  • 2
  • 21
  • 35