简体   繁体   中英

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. Don't forget to assign an ID to the grid so you can easily grab it later using 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

`https://codepen.io/trgiangvp3/pen/JyvRyj`

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM