简体   繁体   English

查询SQL并将结果直接定向到.aspx页

[英]Query SQL and get the result direct to .aspx page

I have a mp3 player in aspx page like this: 我在aspx页面中有一个mp3播放器,如下所示:

<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. 和数据库存储.mp3文件的路径。 Is there anyway to read database then assign them to "#" automatically? 无论如何,有没有读取数据库,然后自动将它们分配给“#”?

Just add an Id and runat attribute to your anchor tag like this 只需将Idrunat属性添加到锚标记中即可,如下所示

<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 通常在带有pushState()集成的html5中使用这种路径

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! 您可以使用jquery插件和许多其他js框架(例如ember.js,boneer.js,angular.js等)轻松实现它!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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