ASP.NET页面中预览图片和flash附加关闭功能


  由于本项目运用了母版页技术,所以document.getElementById()括号中的元素id号有变化,具体参考http://blog.csdn.net/sytWeibo/archive/2009/07/10/4 338880.aspx function LoadImgDiv() { var imgDiv = document.getElementById("ctl00_ContentPlaceHolder1 _divImage"); imgDiv.innerHTML = '' + ''; imgDiv.style.display="block"; } function HideImgDiv() { var imgDiv = document.getElementById("ctl00_ContentPlaceHolder1 _divImage"); imgDiv.style.display="none"; } function LoadFlashDiv() { var flashDiv = document.getElementById("ctl00_ContentPlaceHolder1 _divFlash"); flashDiv.innerHTML = '' + '' + document.getElementById("ctl00_ContentPlaceHolder1 _txtFileName").value + '">' + '' + '' + '' + '' + ''; flashDiv.style.display="block"; } function HideFlashDiv() { var objclose=document.getElementById("objclose"); var flashDiv = document.getElementById("ctl00_ContentPlaceHolder1 _divFlash"); flashDiv.style.display="none"; objclose.outerHTML=""; }   对应的HTML代码:       

你可能感兴趣的:(asp.net)