iframe 调用asp页面实现动态数据展示

4 篇文章 0 订阅
1、用户自定义控件:
<%  @  Control  Language ="C#"  AutoEventWireup ="true"  CodeBehind ="right.ascx.cs"  Inherits ="ProjectName.right"  %>
< div  class ="rightcon">
     < h3 >
         今日指标  <%  --<span class="more">  更多 >></span>-- %>  </ h3 >
     < iframe  src ="cjrlRight.asp"  id  ="iframeColor"    allowTransparency  ="true"    frameborder  ="no"  width  ="262"  style  =" background-color :  #fff"  min-height ="300"  ></ iframe >
</ div >


2.ASP页面 cjrlRight.asp

<!--#include file="conn.asp"-->
<! 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 >
     < meta  http-equiv ="Content-Type"  content  ="text/html; charset=utf-8"  />
     < title > </ title  >
     < link  href ="css/body.css"  rel  ="stylesheet"  type  ="text/css"  />
</ head >
< body  style =" background-color  : #fff"  >
     < div  class ="Froexblcok">
          < table  width ="100%"  border ="0"  cellspacing ="0"  cellpadding ="0"  id ="tableImportant">
                 < tr >
                     < th >
                         时间
                     </ th >
                     < th >
                         国家
                     </ th >
                     < th >
                         指标名称
                     </ th >
                 </ tr >
                <%
                     set  rs=server.createobject( "adodb.recordset"  )
                    sql=  "select * from tableInfo "
                                rs.open sql,conn12,1,1  
                                 if  rs.eof  and  rs.bof  then  response.write  "<span style='color: Black; font-size: 12px;'> 暂无数据  ...</span>    <script type='text/javascript'>document.getElementById('tableImportant').style.display = 'none'; </script>"
                                 do  while  not  rs.eof
                %>
                 < tr >
                     < td >
                        <% = rs(  "TIME" ) %>
                     </ td >
                     < td >
                        <% = rs(  "country" ) %>
                     </ td >
                     < td  class ="tdclass">
                        <% = rs(  "ITEM" ) %><% = rs(  "TableData" ) %>
                     </ td >
                 </ tr >
                <%
                    rs.movenext
                                 loop
                                rs.close
                                 set  rs= nothing
                                conn12.close
                                 set  conn12= nothing   
                %>
             </ table >
     </ div >
</ body >
</ html >
3.ASP.Net页面调用
<%  @   Register  Src ="~/right.ascx"  TagName ="Right"  TagPrefix ="uc2"  %>
<!  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">
   < meta  http-equiv ="Content-Type"  content ="text/html; charset=utf-8"  />
<  title >   </ title  >
<  link   href  ="css/body.css"   rel  ="stylesheet"   type  ="text/css"   />
<  script   type  ="text/javascript"   src  ="js/jquery.min.js"></  script  >
</  head >
<  body >
     <  form   id  ="form1"   runat  ="server">
            <  uc2 :  Right   ID  ="Right"   runat  ="server"   />
     </  form >
</  body >
</  html >




  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值