0
I wonder if I can take the content of a textarea (which in this case is a Texbox) and show in a modal, in my case:
Follow the code I made:
<asp:Label runat="server" CssClass="text-bold" Text="Informe as unidades a serem verificadas"></asp:Label>
<asp:TextBox TabIndex="1" runat="server" ID="txtDevice" CssClass="input-sm form-control" placeholder="Unidade" TextMode="MultiLine" Height="120px" />
<asp:RequiredFieldValidator SetFocusOnError="true" runat="server" ControlToValidate="txtDevice" CssClass="text-danger" ErrorMessage="Campo obrigatório!" ValidationGroup="btnBuscar" Display="Dynamic" />
and further down in the same file, the modal (which I call when I click a button)
<div class="modal fade" id="modalPointerCargo" tabindex="-1" role="dialog" aria-labelledby="modalPointerCargo" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content panel-padrao">
<div class="modal-header">
<h5 class="modal-title">Modal title</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<i aria-hidden="true" class="glyphicon glyphicon-remove"> </i>
</button>
</div>
<div class="modal-body">
QUERO MOSTRAR O CONTÉUDO DO CAMPO AQUI
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary">Save changes</button>
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
How could I do that?
I did what you told me, but it didn’t work, would it be something like that? (I’m asking very simple questions because I’m starting the studies of it this week) <div class="modal-body"> <Asp:Label runat="server" ID="txtModal"></Asp:Label> </div> and the back end protected void Buttonpc_click(Object Sender, Eventargs and) { txtModal.Text = txtDevice.Text; }
– Mateus Mattielo Nickhorn
That’s right, I’ll edit the answer so you can take a test.
– Igor Brandão
Did the answer help solve the problem and can it solve similar questions from other users? If so, don’t forget to mark the answer as accepted. To do this just click on the left side of it (below the indicator of up and down votes).
– Igor Brandão