Live Webinar: Prompt Engineering: Skill Everyone Must Learn Today
x
C# Corner
Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
Play Back Ground Music on Page Load
WhatsApp
Ashish Srivastava
May 23
2016
1.1
k
0
0
Response.AddHeader(
"REFRESH"
,
"5;URL=home"
);
<asp:Content ID=
"Content1"
ContentPlaceHolderID=
"head"
runat=
"Server"
>
<script type=
"text/javascript"
>
function play() {
var audioValue = document.getElementById(
'<%=audioHidden.ClientID%>'
).value;
//alert(audioValue);
embed = document.createElement(
"embed"
);
embed.setAttribute(
"src"
, audioValue);
embed.setAttribute(
"hidden"
,
true
);
embed.setAttribute(
"autostart"
,
true
);
embed.setAttribute(
"loop"
,
true
);
document.body.appendChild(embed);
}
window.onload = function () {
play();
}
</script>
</asp:Content>
<asp:Content ID=
"Content2"
ContentPlaceHolderID=
"cphContents"
runat=
"Server"
>
<div>
<asp:HiddenField ID=
"audioHidden"
runat=
"server"
Value=
"Muskurane.mp3"
/>
</div>
</asp:Content>
ASP.NET
Page Load
Play Back Ground Music
Up Next
Play Back Ground Music on Page Load