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();
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.
Moreover, you could leverage Azure Storage Explorer to check your uploaded audio files.