简体   繁体   中英

Query SQL and get the result direct to .aspx page

I have a mp3 player in aspx page like this:

<a href="#" class="jp-play"></a>
<a href="#" class="jp-pause"></a>
<a href="#" class="jp-prev">Previous Track</a>
<a href="#" class="jp-next">Next Track</a>
<a href="#" class="jp-more-songs">Listen to More Songs</a>

and database store path to .mp3 files. Is there anyway to read database then assign them to "#" automatically?

Just add an Id and runat attribute to your anchor tag like this

<a href="#" id="play" runat="server" class="jp-play">Play</a>

then you will be able to access it in code behind

play.HRef = "http://www.example.com/test.mp3";

generally that kind of paths are used in html5 with pushState() integration

you can easily implement it using jquery plugins and a lot of other js frameworks like ember.js, backbone.js, angular.js among many others!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM