从用户隐藏ASp.net网页内容 [英] Hide ASp.net web page content from User

查看:60
本文介绍了从用户隐藏ASp.net网页内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在asp.net web项目中工作,我有一个场景,我必须隐藏一些和一些时间来自用户的网页的完整内容。我已经工作了div。

如果是的话可以这样做,那么如果没有,那么还有其他方法可以做到这一点。

解决方案

我想如果你为他们提供div标签的id和runat =server的属性,

也许你可以通过将该div的visible属性设置为false来隐藏它们。 / blockquote>

有可能。有很多方法可以做到这一点。上面列出了1种方法,或者您可以使用JavaScript或JQuery。现在它取决于你喜欢哪种方式。如果你没有任何这样的特殊要求,我建议你使用代码隐藏方法。


你可以在服务器端以及客户端这样做



如果你想把它作为服务器端试试



解决方案1 ​​





如果您想在客户端使用,您可以使用类似的JavaScript设置Div的样式的显示属性.. :)



  document  .getElementById(  DivID)。style.display =   none;  //   InVisible  

document .getElementById( DivID)。style.display = ; // 可见



document .getElementById( DivID)。 .display = block; // 可见





问候,

Nirav Prabtani


I am working in asp.net web project, i have a scenario where i have to hide some and some time full content of a web page from user. I have worked divs .
Can this be possible if yes then how, if not then is there any other way to doing this.

解决方案

I think if you give id for div tags and an attribute of runat="server" to them,
maybe you can hide them in code behind by setting the visible property for that div to false.


It is possible. There are many ways to do so. 1 way is posted above, or you may use either JavaScript or JQuery. Now its depends on you which way to prefer. I suggest you to use code behind approach, if you don't have any such special requirement.


You can do it by server side as well client side

If you want it as a server side that try

Solution 1



And if you want to use by client side that you can set display property of a Div's Style using javascript like that.. :)

document.getElementById("DivID").style.display="none";  //InVisible

document.getElementById("DivID").style.display="";  //Visible

or

document.getElementById("DivID").style.display="block";  //Visible



Regards,

Nirav Prabtani


这篇关于从用户隐藏ASp.net网页内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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