使用microsoft.web.ui.webcontrols的TabStrip与IFame组件,达到页的切换效果


事例
http://www.tvmenu.com

ifame代码

<IFRAME id="t_content" frameBorder="0" name="dob" style="WIDTH:100%;HEIGHT:100%" scrolling="auto" src=""></IFRAME>

src设置为空:
在aspx文件最后添加js
<script>
        var tid 
= tb_program.getTab(tb_program.selectedIndex).getAttribute("id").substr(2);//取当前选择的电台的值
        var tweek = tb_week.selectedIndex;//取当前星期值
        function tb_program.onselectedindexchange()//当电台选择时
        {
            var tab 
= tb_program.getTab(tb_program.selectedIndex);
            tid 
=tab.getAttribute("id");
            tid 
= tid.substr(2);
            dolocation(
0);
        }

        function tb_week.onselectedindexchange()
//当星期选择时
        {
            tweek 
= tb_week.selectedIndex;
            dolocation(
0);
        }

//使Iframe导航
        function dolocation(first)
        
{
            
if(first == 0)//是否第一次
                document.all("t_content").src = "content.aspx?tid="+tid+"&tweek="+tweek;
            
else
                document.all(
"t_content").src = "content.aspx?d=1&tid="+tid+"&tweek="+tweek;
            
        }

        dolocation(
1);//第一次时执行
        
</script>

这样速度不是超过,第一次加载的内容也少。
posted on 2005-03-25 18:57  edobnet  阅读(3249)  评论(5编辑  收藏  举报