如何将文本框的样式更改为标签和Viz ... [英] How to change the style of textbox to label and Viz...
本文介绍了如何将文本框的样式更改为标签和Viz ...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
朋友们,我需要尽早发送您的宝贵答案
我的问题是如何将文本框的样式更改为标签和Viz。 。单击编辑按钮
我有一个asp.net列表视图,我必须首先显示员工姓名作为标签然后点击编辑我需要将标签更改为文本框(即不带标签我必须使用文本框作为标签)...
< listview id =lvidrunt =server >
< asp:label id =label1Text ='<%#Eval(emloyeename)%>'runat =servervisible =true/>
< asp:Textbox id =Textbox1Text ='<%#Eval(emloyeename)%>'runat =servervisible =false/>
< / listview>
现在上面的代码将被执行正常...但我想通过点击编辑按钮将标签更改为文本框
提前致谢
解决方案
您可以使用带有readonly标志设置为true的文本框的列表视图。单击编辑只会将其更改为false。
jQuery:
// 在编辑时单击
( #your-list-id input)。attr( readonly, false);保存和加载时
//
( #your-list-id input)。attr( readonly, 真跨度>);
Hi friends I need your valuable answer send as early as possible
My Question is "How to change the style of textbox to label and Viz..after clicking edit button"
I have a asp.net listview in that I have to show the employee name as label first then after clicking Edit i need to change label to textbox (i.e. with out taking label I have to use textbox as label) ...
<listview id="lvid" runt="server"> <asp:label id="label1" Text='<%#Eval("emloyeename")%>' runat="server" visible="true" /> <asp:Textbox id="Textbox1" Text='<%#Eval("emloyeename")%>' runat="server" visible="false" /> </listview>
now the above code will be executed fine... but I want to change lable to textbox by clicking edit button
Thanks in advance
解决方案
You could have a listview with textbox with readonly flag set to true. Clicking edit would simply change that to false.
jQuery:
//On edit click
("#your-list-id input").attr("readonly", "false"); //on save and load
("#your-list-id input").attr("readonly", "true");
这篇关于如何将文本框的样式更改为标签和Viz ...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文