首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

服务器端 怎么操作指定IFRAME的SRC指向?待

2012-03-09 
服务器端 如何操作指定IFRAME的SRC指向?在线等待!HTML:htmlxmlns http://www.w3.org/1999/xhtml hea

服务器端 如何操作指定IFRAME的SRC指向?在线等待!
HTML:
<html   xmlns= "http://www.w3.org/1999/xhtml "   >
<head   runat= "server ">
        <title> 无标题页 </title>
</head>
<body   bottommargin= "0 "   leftmargin= "0 "   rightmargin= "0 "   topmargin= "0 ">
        <form   id= "form1 "   runat= "server ">
          <iframe     id= "top "   src= "../Top.aspx "   height= "90 "   scrolling= "no "   width= "100% "> </iframe>
          <iframe     id= "mainFrame "       height= "450 "   scrolling= "auto "   width= "100% "> </iframe>
        </form>
</body>
</html>

CS:
    服务器端组合出如下的URL,ConfigurationManager.AppSettings[ "urlDirectory "]   +   this.Request.QueryString[ "url "].ToString()   。想控制 <iframe     id= "mainFrame "转到上面组合出的URL,该如何实现?

[解决办法]
1.可以加个runat= "server "然后this.top.Attibute[ "src "] = "... "或 <iframe id= "top " src= ' <%=变量%> '
[解决办法]
例子: IFRAME1.Attributes.Add( "src ", "RateDistribute.aspx?ServiceRateID= " + nRetID + " ");

热点排行