ASPForums.Net RSS Feedhttp://www.aspforums.net/Handlers/RSS.ashxLatest additions to the content that appears on ASPForums.Net(c) 2019 www.aspforums.com. All rights reserved.AutoPlay Audio On Page Load using Code Behind in C# and VB.Net<p>Hi <a class="username" rel="nauna">nauna</a>,</p> <p>Refer below sample.</p> <p><span style="text-decoration: underline;"><strong>HTML</strong></span></p> <pre class="brush: html">&lt;audio controls id=&#34;buzz&#34; runat=&#34;server&#34; type=&#34;audio/mp3&#34; /&gt;</pre> <p><span style="text-decoration: underline;"><strong>Code</strong></span></p> <p><strong>C#</strong></p> <pre class="brush: csharp">protected void Page_Load(object sender, EventArgs e) { &nbsp;&nbsp;&nbsp; buzz.Attributes.Add("autoplay", "autoplay"); &nbsp;&nbsp;&nbsp; buzz.Attributes["src"] = "Test.mp3"; }</pre> <p><strong>VB.Net</strong></p> <pre class="brush: vb">Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handle Me.Load &nbsp;&nbsp;&nbsp; buzz.Attributes.Add("autoplay", "autoplay") &nbsp;&nbsp;&nbsp; buzz.Attributes("src") = "Test.mp3" End Sub</pre> <p>&nbsp;</p>https://www.aspforums.net:443/Threads/194288/AutoPlay-Audio-On-Page-Load-using-Code-Behind-in-C-and-VBNet/https://www.aspforums.net:443/Threads/194288/AutoPlay-Audio-On-Page-Load-using-Code-Behind-in-C-and-VBNet/Mon, 09 Sep 2019 03:35:39 GMT