简体   繁体   English

我有一个文本框,我希望用户单击按钮时可以切换到网格。 在asp.net中可以吗?

[英]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.

相关问题 我想在单击停止按钮时显示五彩纸屑。 单击停止按钮时如何在整个页面上显示五彩纸屑 - I would like to display a confetti when i click on the stop button. How do i display a confetti on the whole page when i click on stop button 当我单击asp.net中的退出按钮时,不会触发textbox onblur事件 - textbox onblur event not fired when i click the exit button in asp.net 我有一个动态 html 模板。 当我单击一个按钮时,哪个 forms 。 现在,问题是当我单击一个按钮时,所有按钮都被单击 - I have a dynamic html template. Which forms when I click on a button. Now, the problem is When I click on one button all buttons are clicked 我有两个复选框“接受”和“拒绝”并提交按钮。 当我单击提交按钮时,它应该检查勾选了哪个复选框 - I have two check boxes “Accept” and “Decline” and submit button. When i click on submit button it should check the which check box is ticked 当我单击编辑图像时,我希望我的编辑功能能够正常工作 - I would like to have my edit function to work when i click on the edit image 我在asp.net webform中已经有3个复选框和1个文本框,当我选中1和2复选框时,结果文本框将为1,2 - I already have 3 checkboxes and 1 textbox in asp.net webform when i check 1and 2 checkbox then result in textbox will be 1,2 单击我的菜单按钮时,我需要出现一个菜单。 这是 OnClick function 还是 CSS 代码? 这是Python和Flask网页 - I am needing a menu to appear when clicking my menu button. I Would this be an OnClick function or CSS code? This is for Python with Flask webpage 当我在 asp.net mvc 中使用 javascript 单击按钮时,我无法将产品添加到购物车 - I cannot add a product to cart when I click the button using javascript in asp.net mvc 当我在文本框中键入任何内容时,它应该在asp.net中启动? - When I type anything in Textbox then it should fire in asp.net? 为什么在单击使用JavaScript的输入按钮时,我的asp.net页已刷新? - Why on click of a input button using JavaScript i am getting my asp.net page refreshed?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM