Hot Ti 在运行时在 ASP.NET 表单中插入脚本

发布于 2024-11-14 07:58:46 字数 762 浏览 5 评论 0原文

我将可视化保存在数据库、标题、描述等和代码字段中,在代码字段中我保存将生成可视化的“代码”,它可能就像托管在某处的图像的 URL 一样简单,或者类似于:

<script src="https://spreadsheets.google.com/gpub?url=http%3A%2F%2Foj0ijfii34kccq3ioto7mdspc7r2s7o9-ss-opensocial.googleusercontent.com%2Fgadgets%2Fifr%3Fup_title%3DBrands%26up_initialstate%26up__table_query_url%3Dhttps%253A%252F%252Fspreadsheets.google.com%252Fspreadsheet%252Ftq%253Frange%253DA%25253AE%2526key%253D0AqFjLMbUaBn_dFhwbV9DQ3N6cWN1SmFiUlF5X1RXUkE%2526gid%253D0%2526pub%253D1%26url%3Dhttp%253A%252F%252Fwww.google.com%252Fig%252Fmodules%252Fmotionchart.xml%26spreadsheets%3Dspreadsheets&height=448&width=710"></script>

我将其保存为数据库中的 nvarchar(max) ,现在我有一个页面应该显示我在运行时调用的可视化效果,那么最好的方法是什么?!例如一个div?又如何呢?

提前致谢

I am saving Visualizations in a database, title, description...etc and CODE field, in the Code field I save the "code" that will generate the visualization, it may be as simple as a URL for an image hosted somewhere, or something like:

<script src="https://spreadsheets.google.com/gpub?url=http%3A%2F%2Foj0ijfii34kccq3ioto7mdspc7r2s7o9-ss-opensocial.googleusercontent.com%2Fgadgets%2Fifr%3Fup_title%3DBrands%26up_initialstate%26up__table_query_url%3Dhttps%253A%252F%252Fspreadsheets.google.com%252Fspreadsheet%252Ftq%253Frange%253DA%25253AE%2526key%253D0AqFjLMbUaBn_dFhwbV9DQ3N6cWN1SmFiUlF5X1RXUkE%2526gid%253D0%2526pub%253D1%26url%3Dhttp%253A%252F%252Fwww.google.com%252Fig%252Fmodules%252Fmotionchart.xml%26spreadsheets%3Dspreadsheets&height=448&width=710"></script>

I am saving this as an nvarchar(max) in my database, now I have a page that should display the visualization I call on run time, so what is the best way to do so?! a div for example? and how?

Thanks in dvance

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦里的微风 2024-11-21 07:58:46

好的,开始吧 Maen ...

1) 声明您的 IFrame(您可以设置更多属性,例如高度和宽度):

<IFRAME id="frame1" scrolling="auto" runat="server">
</IFRAME>

2) 从存储在数据库中的“脚本”获取 URL

frame1.Attributes["src"] = DAL.GetURLPath();

这有帮助吗?

ok, here you go Maen ...

1) Declare your IFrame (you can set more properties like height & width):

<IFRAME id="frame1" scrolling="auto" runat="server">
</IFRAME>

2) Get the URL from your "Script" stored in your Database

frame1.Attributes["src"] = DAL.GetURLPath();

does this help?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文