如何在编辑模式下隐藏文本框 [英] How Do I Hide Textbox In Edit Mode

查看:85
本文介绍了如何在编辑模式下隐藏文本框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello Guys我有问题如何隐藏此文本框在编辑模板中?返回代码

 <   HeaderTemplate  >  
ID < br / >
< asp:TextBox ID = IDSrch runat = server < span class =code-attribute> OnTextChanged = IDSrch_TextChanged > < / asp:TextBox >
< / HeaderTemplate >

解决方案

(来自一个班轮问题的任何内容)

不确定后面的代码,但是jQuery可以提供很好的帮助。使用jQuery从客户端隐藏文本框。

在客户端使用特定检查来查看网格是否处于编辑模式或从后面的代码设置标志(隐藏字段等),以便让客户端知道网格是可编辑的。并隐藏文本框。



 


('<%= IDSrch.ClientID%>' ).hide();





或者你可以详细说明这种情况,如果这没有用。


基本上当你使用gridview文本框时会有动态ID创建,你无法隐藏特定的文本框,你需要使用客户端脚本来隐藏文本框,或者你需要在代码后面运行代码来隐藏整个列

Hello Guys i Have Question How i Hide this textbox In edit template ? Back Code

<HeaderTemplate>
                    ID<br />
                    <asp:TextBox ID="IDSrch" runat="server" OnTextChanged="IDSrch_TextChanged"></asp:TextBox>
                </HeaderTemplate>

解决方案

(from whatever I got from the one liner question)
Not sure about back code, but jQuery can help in great way. Hide text box from client side using jQuery.
Use specific check on client side to see if grid is in edit mode or set flag(hidden field etc) from back code to let client side know that the grid is editable. and hide textbox.


('<%= IDSrch.ClientID %>').hide();



Or you can elaborate more about the situation if this doesn't help.


basically when you use gridview textbox there is dynamic ID creation, and you can not hide particular textbox box, you need to either use client side scripting to hide textboxes or you need to run code behind code to hide entire column


这篇关于如何在编辑模式下隐藏文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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