[英]I have a textbox which I would like to allow my users to switch to a grid when they click a button. Is this possible in asp.net?
As of now I have a multiline textbox for my users. 到目前为止,我为用户提供了一个多行文本框。 I would like my users to be able to switch the textbox into a grid layout when they click a button "Switch to Grid".
我希望我的用户在单击“切换到网格”按钮时能够将文本框切换为网格布局。 How can I remove the textbox and make a grid layout appear in the same place when they click this button?
当他们单击此按钮时,如何删除文本框并使网格布局显示在同一位置? If the user has already inputed something into the textbox/grid-layout, I'm okay with their inputs getting reset.
如果用户已经在文本框/网格布局中输入了一些内容,那么我可以重置其输入。
<asp:TextBox ID="txtvalue" ValidationGroup="g1" TextMode="MultiLine" runat="server" style="width:100%; max-width:100%; overflow-x:scroll; height:110px; white-space:nowrap; word-wrap:break-word;"></asp:TextBox>
You should put a grid right after your textbox and make the grid default hidden by css. 您应该在文本框后放置一个网格,并使该网格默认被css隐藏。 Don't forget to assign an ID to the grid so you can easily grab it later using jQuery.
不要忘记为网格分配一个ID,这样以后您就可以轻松地使用jQuery来获取它。 Then when your user click on Switch to Grid button, all you have to do now is quite simple: first, make the textbox hidden and then make the grid appeared.
然后,当用户单击“切换到网格”按钮时,现在要做的就是非常简单的操作:首先,使文本框处于隐藏状态,然后使网格出现。
I've made a CodePen here 我在这里做了一个CodePen
`https://codepen.io/trgiangvp3/pen/JyvRyj`
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.