如何将单个控件切换到标签和文本框并返回标签 [英] How can i switch single control to label and textbox and back to label
问题描述
Hii,
< asp:TextBox ID =txtCommentCssClass =Form_InputFieldTextMode =MultiLine行=3Width =98%runat =serverText ='<%#Eval(Comment)%>'Enabled =falseFont-Bold =trueFont-Names =Arial >
之前我正在做的是..当用户点击编辑时,我启用此文本框,他可以更改文本,然后更新它和textox再次设置为enabled = false ...
这次我的客户要求是...当我点击编辑它显示一个文本框在其中添加coments ..但是我说更新它..然后它会将其转换为标签并显示更新的评论...我怎么能点那个
Hii,
<asp:TextBox ID="txtComment" CssClass="Form_InputField" TextMode="MultiLine" Rows="3" Width="98%" runat="server" Text='<%# Eval("Comment")%>' Enabled="false" Font-Bold="true" Font-Names="Arial">
previously what i am doing is .. when user click on edit i make this text box enabled and he can change the text and then update it and textox set to enabled=false again ...
this time my clients requirement is ... when i click on edit it shows an textbox to add coments in it .. but whn i say update it .. then it will convert it into label and displays the updated comment ... how can i dot that
推荐答案
这里可以有两个控件。一个是标签,另一个是文本框。一次只显示一个。当用户点击编辑显示文本框时,用户输入数据并更新。然后将数据复制到标签并显示它并隐藏文本框。
You can have two controls here. One is label and other is textbox. Show only one at a time. When user click on edit show the textbox, user enter the data and update . Then copy the data to the label and show it and hide textbox as well.
这篇关于如何将单个控件切换到标签和文本框并返回标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!