当前位置:编程学习 > C#/ASP.NET >>

请问各位大虾怎么把asp页面iframe到asp.net中

我们网站是asp.net的,现在想把一个asp的信息发布系统插入到这个网站中,请问怎么写程序将asp的程序iframe到asp.net中,请给出详细过程,非常感谢... --------------------编程问答-------------------- 应该没关系吧
iframe里可引用一切URL

我就弄过百度。。。。。 --------------------编程问答-------------------- 跟asp.net嵌入iframe是一样的  没区别吧 --------------------编程问答--------------------
<iframe src ="something.asp " id ="something" ></iframe>
--------------------编程问答-------------------- 直接用iframe不行吗? --------------------编程问答-------------------- 都行,直接用URL地址 --------------------编程问答-------------------- iframe属于HTML标准标记,与语言无关,任何语言都可以使用  --------------------编程问答-------------------- 各位大虾不要见笑 小弟我是菜鸟 不懂asp.net 直接引用的asp好像不能运行
我看见有人这么写:
default.aspx页面如下:
<table width="930" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
        <td align="left" >
            <iframe id="frame_content3" src="Info.aspx" scrolling="no" frameborder="0" width="100%" marginwidth="0" marginheight="0" allowtransparency="true"></iframe>
<script type="text/javascript">
function reinitIframe2(){
var iframe = document.getElementById("frame_content3");
try{
iframe.height =  iframe.contentWindow.document.documentElement.scrollHeight;
}catch (ex){}
}
window.setInterval("reinitIframe2()", 200);
</script>


        </td>
    </tr>
</table>
info.aspx页面如下:
<%@ page language="C#" autoeventwireup="true" inherits="Info, App_Web_jvnhx4ms" enableEventValidation="false" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>无标题页</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
     <table width="930" border="0" align="center" cellpadding="0" cellspacing="0"  >
    <tr>
        <td align="center">
            <%--<img src="UploadFiles/Default/xinxiguangchang.jpg"  width="930"/>--%>
           <iframe id="frame_content" src="info_new/index.asp" scrolling="no" frameborder="0" width="100%" marginwidth="0" marginheight="0"  allowtransparency="true"></iframe>
<script type="text/javascript">
function reinitIframe(){
var iframe = document.getElementById("frame_content");
try{
iframe.height =  iframe.contentWindow.document.documentElement.scrollHeight;
}catch (ex){}
}
window.setInterval("reinitIframe()", 200);
</script>
        </td>
    </tr><tr>
        <td>
                
        </td>
    </tr>
    </table>
    </div>
    </form>
</body>
</html>


然后才是引用的我的asp程序。我想知道他这个是怎么实现的,请高手给讲解一下,谢谢大家... --------------------编程问答-------------------- asp.net中iframe详细用法

例子1。

<iframe width=420 height=330 frameborder=0 scrolling=auto src=URL></iframe>

不用多说了。

  width插入页的宽;height插入页的高;scrolling 是否显示页面滚动条(可选的参数为 auto、yes、no,如果省略这个参数,则默认为auto);frameborder 边框大小;

  注意:URL建议用绝对路径

  传说中百度用:<iframe width=0 height=0 frameborder=0 scrolling=auto src=“http://WWW .xhit.cn"></iframe>

  例子2。

  如果一个页面里面有框架。。随便点页面里的连接,要求在这个<iframe> 里打开。在iframe 中加入name=****(**自己设定)

<iframe name=**** ></iframe>

  然后在修改默认打开模式,:网页HEAD中加上<a href=URL target=**>或部分连接的目标框架设为(**)

  例子3。

  要插入一个页面。要求只拿中间一部分。其他的都不要。,。。

  代码:

<iframe name=123 align=middle marginwidth=0 marginheight=0 vspace=-170 hspace=0 src= frameborder=no scrolling=no width=776 height=2500></iframe>


  控制插入页被框架覆盖的深度 marginwidth=0 marginheight=0;控制框架覆盖上部分的深度 vspace=-170 

  scrolling滚动条要否(auto、yes、no)   frameborder框架的边框大小,width=776 height=2500此框架的大小。

  一、页面内加入iframe

<iframe width=420 height=330 frameborder=0 scrolling=auto src=URL></iframe>,
scrolling表示是否显示页面滚动条,可选的参数为auto、yes、no,如果省略这个参数,则默认为auto。

  二、超链接指向这个嵌入的网页,只要给这个iframe命名就可以了。方法是<iframe name=**>,例如我命名为aa,写入这句HTML语言<iframe width=420 height=330 name=aa frameborder=0 src=></iframe>,然后,网页上的超链接语句应该写为:<a href=URL target=aa>

三、如果把frameborder设为1,效果就像文本框一样

  透明的IFRAME的用法

  必需IE5.5以上版本才支持

  在transparentBody.htm文件的<body>标签中,我已经加入了style="background-color=transparent" 通过以下四种IFRAME的写法我想大概你对iframe背景透明效果的实现方法应该会有个清晰的了解:

<IFRAME ID="Frame1" SRC="transparentBody.htm" allowTransparency="true"></IFRAME> 

<IFRAME ID="Frame2" SRC="transparentBody.htm" allowTransparency="true" STYLE="background-color: green"> </IFRAME>

<IFRAME ID="Frame3" SRC="transparentBody.htm"></IFRAME>

<IFRAME ID="Frame4" SRC="transparentBody.htm" STYLE="background-color: green"> </IFRAME>



4.建议放在<div> 和</div>里面方便布局格式
  --------------------编程问答-------------------- 不是不行  
是vs内部的虚拟iis是不支持这样的
你发布到iis里面就可以看到了 --------------------编程问答--------------------
引用 9 楼 biaofanwo 的回复:
不是不行  
是vs内部的虚拟iis是不支持这样的
你发布到iis里面就可以看到了


你能帮我解释一下下面这个JavaScript函数有什么用吗?
<iframe id="frame_content0" src="info_new/indexs.asp" scrolling="no" frameborder="0" width="100%" marginwidth="0" marginheight="0"  allowtransparency="true"></iframe>
<script type="text/javascript">
function reinitIframe0(){
var iframe = document.getElementById("frame_content0");
try{
iframe.height =  iframe.contentWindow.document.documentElement.scrollHeight;
}catch (ex){}
}

没有这个函数的时候怎么不能显示啊?放上这个函数就能显示了!
window.setInterval("reinitIframe0()", 200);
</script> --------------------编程问答-------------------- 那段代码就是每个一段200毫秒刷新那个Iframe.
补充:.NET技术 ,  ASP.NET
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,