<Div Id="testDiv" runat="Serve">
testDiv.Style.Add("display", "none");//显示
testDiv.Style.Add("display", "block");//隐藏
block=显示,,none=隐藏
也可以不用设置 runat=“server”
后台通过js来控制
string myScript = @”function AlertHello() { document.getElementById("div1").style.display="block";}”;
Page.ClientScript.RegisterClientScriptBlock(this.GetType(),
“MyScript”, myScript, true);