如何在asp.net中隐藏面板和控件 [英] how to hide panel and controls in asp.net

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

问题描述

如何隐藏面板及其控件。

plz帮助我

解决方案

您可以双向隐藏面板和控件。

1)使用visible = true / false属性

2)使用jquery



以下是对例如:

1)使用visible = true / false属性:

 <   asp:Panel     ID   =  Panel1    runat   =  server   可见  =  false >  
< asp: TextBox ID = TextBox1 runat = server > < / asp:TextBox >
< / asp:Panel >





2)使用jquery

 < span class =code-keyword><   script     type   =  text / javascript >  

( #ctl00_contentdetails_pnl)隐藏();
< / script >


在面板控件中将visible属性设置为false。它将隐藏面板及其所有控件。

读取如何动态显示或隐藏控件 [ ^ ]对JQuery做同样的事情


how to hide the panel and its controls .
plz help me

解决方案

You can hide panel and controls two way.
1) using visible=true/false property
2) using jquery

Below are the explanation with example:
1) using visible=true/false property :

<asp:Panel ID="Panel1" runat="server" Visible="false">
        <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
    </asp:Panel>



2) using jquery

<script type="text/javascript">


("#ctl00_contentdetails_pnl").hide(); </script>


set the visible property as false in your panel control. it will hide panel and its all controls.
read How to Show or Hide Controls Dynamically[^] for doing the same with JQuery


这篇关于如何在asp.net中隐藏面板和控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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