在aspx页面中显示html内容 [英] display html content inside aspx page

查看:588
本文介绍了在aspx页面中显示html内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hi
  I want to display the below text file as it is in my web page. It shouldn't be inside textbox and iframe.

text file:

<!DOCTYPE html>

<html>

<head>

<script type="text/javascript">alert('hello');</script>

</head>

<body load="call()">

<h1>My First Heading</h1><pre lang="HTML">

<p>My first paragraph.</p>

</body>

</html>





请建议我。

感谢Prafulla



please suggest me.
Thanks Prafulla

推荐答案

如果你想在同一页面中显示它,你可以将html正文的内容粘贴到你的面板。



如果您的html内容将来会发生变化,并且您希望它保持不同的页面,请使用iframe并将其设置为显示您的html页面。



如果你想要两者结合,你可以使用 asp.net Literal控件,阅读你的html页面的内容并设置内容html到文本Literal的属性。
If you want to show it in the same page, you can just paste the contents of the html body between your panels.

If your html content will change in future, and you want it to remain a different page, use an iframe and set it to display your html page.

If you want to combine both, you can use a asp.net Literal control, read the contents of your html page and set the contents of the html to the Text property of Literal.


尝试使用< xmp>< / xmp>标记。

将您的代码作为示例块



HTML示例元素(< xmp>)在两者之间呈现文本开始和结束标签,无需解释其间的HTML并使用等宽字体



xmp-Tag [ ^ ]
Try using <xmp></xmp> Tag .
which takes your code as example block

The HTML Example Element (<xmp>) renders text between the start and end tags without interpreting the HTML in between and using a monospaced font

xmp-Tag[^]


这篇关于在aspx页面中显示html内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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