我的页面布局从上到下分为3个部分,大体是这样的
A
B
C其中A中有RadioButton1,RadioButton2,当我点击RadioButton1的时候页面布局变成
A
C
这个B的地方会隐藏,C的位置会占用B的位置,当点击另一个RadioButton2的时候
又变为
A
B
C
这样的布局,B的位置又会显现出来我现在的问题就是我不知道B的这个地方应该用什么样的控件,应该使用Panel加上另外一个AJAX控件吧?可是我不知道具体用什么和怎么用,用过ModalPopup控件,可是达不到我要的效果,谢谢指教一下,端午节大家快乐

解决方案 »

  1.   

    用一个<div>,让他style.display="none"或者用Panel,让它 panel1.Visible = false;
      

  2.   

    panel1.Visible = false这个我也想到了,可是当我B的panel1.Visible = false的时候,我的C没有实现存在于B的部分
    而那个style.display="none",我没试过
    但是我这个需要无刷新做出来
    所以应该用的是AJAX的某一个控件做出来的,对不对?
      

  3.   

    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
        <title>无标题页</title>
        <script type='text/JavaScript'>
        function showHide()
        {
            if(document.getElementById("RadioButton1").checked)
            {
                document.getElementById("B").style.display = "none";
            }
            else
            {
                document.getElementById("B").style.display = "block";          
            }
        }
        </script>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            <div id="A">
                <asp:RadioButton ID="RadioButton1" runat="server" GroupName="A" />
                <asp:RadioButton ID="RadioButton2" runat="server" GroupName="A" />
            </div>
             <div id="B">
                 <asp:Label ID="Label1" runat="server" Text="B"></asp:Label>
            </div>
            <div id="C">
                <asp:Label ID="Label2" runat="server" Text="C"></asp:Label>
            </div>       
        </div>    </form>
    </body>
    </html>protected void Page_Load(object sender, System.EventArgs e)
    {
        RadioButton1.Attributes.Add("onclick", "showHide()");
        RadioButton2.Attributes.Add("onclick", "showHide()");
    }