如何在javascript中隐藏的代码隐藏中使控件可见 [英] how to make control visible in codebehind which is invisible in javascript

查看:87
本文介绍了如何在javascript中隐藏的代码隐藏中使控件可见的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个div

as



Hi , I have a div
as

<div id="divPagOfPage"  runat="server"></div>





i让它在客户端看不见





i have made it invisible in clientside as

document.getElementById("divPagOfPage").style.display = "none";



现在我再想要这个div是可见的,为此我已经在codebehind中写了代码

as


Now i want again this div to be visible ,for this i have wrote code in codebehind
as

divPagOfPage.Style.Add("display", "inline");
  divPagOfPage.Visible = true;






and also

  ScriptManager.RegisterStartupScript(this, this.GetType(), "starScript", "ShowdivPagOfPage();", true);
function ShowdivPagOfPage(){
document.getElementById("divPagOfPage").style.display = "inline";

}





我尝试了以上三个代码,但div仍然是隐形的。如何制作它在密码隐藏中可见,在cleintside中隐藏。



I tried all the three above code but still the div is invisible.How to make it visible in codebehind which is made invisible in cleintside.

推荐答案





你能不能试试给''阻止''代替''内联'',



document.getElementById(id).style.display =''block'';



谢谢,

BS
Hi,

Could you please try giving ''block'' instead of ''inline'',

document.getElementById(id).style.display = ''block'';

Thanks,
B.S


这篇关于如何在javascript中隐藏的代码隐藏中使控件可见的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆