ASP.NET中怎样动态更改Table控件的背景颜色?在线等!Table控件为HTML中的控件.非常感谢!

解决方案 »

  1.   

    如果是html只能想办法用js了
    或者改成server的,就可以直接控制了
      

  2.   

    对啊!TABLE只能用JS来实现
    具体的你搜索在GOOGLE里
      

  3.   

    呵呵,今天下午刚和别人研究了这问题
    window.document.getElementById("Table1").style.backgroundColor="blue";
      

  4.   

    seaonce(雨花中的小皮鞋),我照着写了,怎么不行啊?具体在哪儿写啊?1.window.document.getElementById("Table1").style.backgroundColor="blue";
    2.Response.Write("<script>window.document.getElementById('Table1').style.backgroundColor='blue'</script>");以上两种方法都不行啊.第一种提示没有using集合.请多指教!
      

  5.   

    我在HTML中写了如下代码,已经实现了颜色的改变,非常感谢!
    现在我想颜色是动态的,颜色的值是来自上一个窗体的,我可以在此页上放置一个Label,用Request.Querysting["aaa"]得到,但怎样传给函数bgcolor()呢?
    <body onload="bgcolor();">
    <script language="javascript">
    function bgcolor()
    {
    window.document.getElementById("t_frame_left").style.backgroundColor="#cc9966";
    }
    </script>
      

  6.   

    这个我已经实现了,代码如下:
    <body onload="bgcolor(window.text1.value);">
    <script language="javascript">
    function bgcolor(str)
    {
    window.document.getElementById("t_frame_left").style.backgroundColor=str;
    }
    </script>
    现在text1这个控件是HTML控件,我想让它得到上一个网页传来的参数值,如果是服务器控件的话,直接
    Request.Querysting["aaa"]就行了,可这是html控件,该怎么办?给个思路也行,谢谢了!
      

  7.   

    可以通过JS取得本画面的URL,再从URL中取出前画面传来的参数,就可以在JS里传给TEXT1了
    实现如下:
    function GetUrl()
    {
    var url=parent.location.search;
    var Request = new Object();
    var parameter;

    if(url.indexOf("?") != -1)
    {
    var splitURL  = new Array();
    splitURL = url.split("&");
    }
             window.document.getElementById("text1").value = splitURL[i].split("=")[1];
    }
    注:splitURL[i]中的i是要赋给text1的参数在前画面传的所有参数中的位置,如果你把要传给text1的参数放在第一位,i就改成0,
      

  8.   

    修改一下
    function GetUrl()
    {
    var url=parent.location.search;
    var parameter;

    if(url.indexOf("?") != -1)
    {
         var splitURL  = new Array();
                  splitURL = url.split("&");
         window.document.getElementById("text1").value = splitURL[i].split("=")[1];
             }
             
    }