aspx页面和html页面的区别如下:
1、.aspx文件
.aspx是ASP.NET 页面的扩展名。它无非是在静态HTML网页里面嵌入了动态的指令(这些动态指令是由各种脚本语言编写的,是由IIS服务器上的脚本引擎来执行的)而已。如果浏览器请求某张 ASP.NET 页面,那么在把结果发回浏览器之前,服务器首先会处理页面中的可执行代码(即,脚本语言代码 )。
也就是说,一个asp网页主要包含两个部分:
⑴ HTML静态网页要素:由IE浏览器解释执行
⑵ asp脚本命令:由IIS脚本引擎解释执行
2、.html文件
.html文件是基于HTML的静态网页,它的内容是固定不变的。其页面内容使用的仅仅是标准的HTML代码,最多再加上流行的gif、flash等格式的动态图片,还有产生动态的字幕等动画效果。
当客户机通过IE浏览器向Web服务器请求提供网页内容时,服务器仅仅是将已经设计好的静态HTML文档传送给用户浏览器。
分别在html页和aspx页插入脚本语言,对比运行效果:
说明:
静态HTML语言的要素定义的是数据如何显示,而不能如何动态生成数据,所以单纯使用HTML制作的网页就是静态的。
方案1:/// <summary>
/// 传入URL返回网页的html代码
/// </summary>
/// <param name="Url">URL</param>
/// <returns></returns>
public static string getUrltoHtml(string Url)
{
errorMsg = ""
try
{
System.Net.WebRequest wReq = System.Net.WebRequest.Create(Url)
// Get the response instance.
System.Net.WebResponse wResp =wReq.GetResponse()
// Read an HTTP-specific property
//if (wResp.GetType() ==HttpWebResponse)
//{
//DateTime updated =((System.Net.HttpWebResponse)wResp).LastModified
//}
// Get the response stream.
System.IO.Stream respStream = wResp.GetResponseStream()
// Dim reader As StreamReader = New StreamReader(respStream)
System.IO.StreamReader reader = new System.IO.StreamReader(respStream, System.Text.Encoding.GetEncoding("gb2312"))
return reader.ReadToEnd()
}
catch(System.Exception ex)
{
errorMsg = ex.Message
}
return ""
}
你可以用这个函数获取网页的客户端的html代码,然后保存到.html文件里就可以了。
通过嵌套iframe 实现引用html页面<script type="text/javascript">
$(function () {
document.getElementById("ifm").src =""//Url地址
$("#ifm").load(function () {
var h = document.body.clientHeight
var w = document.body.clientWidth
document.getElementById("ifm").height = h + "px"
document.getElementById("ifm").width = w + "px"
})
})
</script>
<body style="overflow-y:hiddenoverflow-x:hidden">
<div id="pageone" style="">
<iframe name="ifm" id="ifm" scrolling="yes" style="background-color: transparent" marginwidth="0" marginheight="0" frameborder="0">
</iframe>
</div>
</body>