我可以将 HTML 代码放入标签中以显示在我的页面中吗?

发布于 2024-08-04 10:44:53 字数 271 浏览 2 评论 0原文

ASP.NET 与 C#: 我有一个网页,旨在作为帮助页面。实际上,我正在使用树视图组件,当有人单击节点时,页面上的标签将通过从文本文件读取文本来更改文本。

我想要的是将一些图像放在帮助中,因此 .txt 文件不适合。所以我可以使用 .html 文件代替。

如何读取这样的 .html 文件并将其显示在我的页面中?我可以用其他东西替换标签吗?

ASP.NET with C#:
I have a web page which is intended to be a help page. Actually I am using a treeview component, and when someone clicks on a node a label on the page will change text by reading it from text file.

what I want is to put some images in the help so a .txt file will not be suitable. So I may use a .html file instead.

How to read such a .html file and display it in my page? May I replace the label with some thing else or what?

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

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

发布评论

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

评论(3

优雅的叶子 2024-08-11 10:44:53

使用 ASP.NET Literal 控件反而。 Literal 控件用于在页面上显示文本。文本是可编程的。

注意:此控件不允许您将样式应用于其内容!

<asp:Literal />

Use ASP.NET Literal control instead. The Literal control is used to display text on a page. The text is programmable.

Note: This control does not let you apply styles to its content!

<asp:Literal />
旧梦荧光笔 2024-08-11 10:44:53

使用 - 这是一种将内容块插入页面的更通用的方法。

Use <asp:PlaceHolder runat="server"> - it's a more general purpose way of inserting blocks of content into a page.

治碍 2024-08-11 10:44:53

使用占位符或文字 asp 控件,因为这些控件不会为其自身添加任何 html,它只是呈现内部内容。

但例如普通的 asp 标签将呈现为跨度。

Use placeholder or literal asp control, because these controls don't put any html for its self, it just render whats inside.

But for example the normal asp label will render as a span.

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