在选取框内包含来自数据库的数据 [英] Include data from database inside a marquee

查看:60
本文介绍了在选取框内包含来自数据库的数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在"marquee"标记中包含一些超链接,其中包含数据库中的值,以使页面具有动态性.

我应该怎么做?

谢谢

I want to include some hyperlinks inside the "marquee" tag with the values from the database so as to make the page dynamic.

How should I do that??

Thank you

推荐答案

aspx页面的页面加载,
打开与数据库的连接,
在上面执行您的sql,使用executeScalar取回字符串或其他..

给您的字幕"一个ID,然后Runat = server

在代码中设置选取框的innerhtml =来自数据库的字符串


基本上
marquee1.innerhtml =< a href = \""+ sqlconn.executeScalar(\"从链接表中选择链接,其中linkid = 121 \"+")a>单击我滚动链接</a>"
in the page load of the aspx page,
open connection to database,
execute your sql on it, use an executeScalar to get a string back or whatever..

give your ''marquee'' an ID and Runat = server

in the code set the innerhtml of the marquee = the string from the database


basically
marquee1.innerhtml = "<a href=\"" + sqlconn.executeScalar(\"select link from linkstable where linkid=121 \" + ") a> Click Me Scrolling Link </a>"


这篇关于在选取框内包含来自数据库的数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆