在客户端用JS如何隐藏用户控件?
<%@ Page Language= "C# " AutoEventWireup= "true " CodeFile= "Default.aspx.cs " Inherits= "_Default " %>
<%@ Register TagPrefix= "DaoHang1 " TagName= "Style1 " Src= "~/Style1.ascx " %>
<%@ Register TagPrefix= "DaoHang2 " TagName= "Style2 " Src= "~/Style2.ascx " %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN " "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<html xmlns= "http://www.w3.org/1999/xhtml " >
<head runat= "server ">
<title> 导航 </title>
<link href= "style.css " rel= "stylesheet " type= "text/css "/>
<script language= "javascript ">
//改变样式
function changeStyle()
{
var obj = document.getElementById( "DlistStyle ");
var index = obj.selectedIndex;
if(obj.options[index].value == "01 ")
{
document.getElementById( "style1 ").style.display = "none ";
document.getElementById( "style2 ").style.display = "block ";
}
else if(obj.options[index].value == "02 ")
{
document.getElementById( "style1 ").style.display = "none ";
document.getElementById( "style2 ").style.display = "block ";
}
else if(obj.options[index].value == "03 ")
{
window.alert( "none ");