Adding TextBox with default value

Joined
Jan 13, 2023
Messages
10
Reaction score
1
Hi,

I have this code fragment:

ASP.net:
ASP.NETCopy



<div class="DetailsBoxContent">
<asp:UpdatePanel runat="server" ID="Run Report" UpdateMode="Conditional">
    <ContentTemplate>
<asp:Panel ID="pnlGenerateRpt" runat="server">
<div style="padding: 10px; text-align: center; width: 100%; float: right;">
<asp:Button ID="btnGenerateRpt" runat="server" CssClass="StdButton" Text="Generate Report" OnClick="btnGenerateRpt_Click" />
        </div>
      </asp:Panel>
    </ContentTemplate>
    <Triggers>
<asp:PostBackTrigger ControlID="btnGenerateRpt" />
    </Triggers>
  </asp:UpdatePanel>
</div>


I would like to add a label & textbox right to the existing button. The textBox needs to have a default value of 0 but can be amended by user.

How to achieve this ?

Thank you
 
Joined
Jan 8, 2023
Messages
27
Reaction score
2
You can add a label and textbox right to the existing button by adding the following code within the div element containing the button:
Code:
<div style="float: left; padding-right: 10px;">
    <asp:Label ID="lblTextbox" runat="server" Text="Textbox Label:" />
    <asp:TextBox ID="txtTextbox" runat="server" Text="0" />
</div>

This will create a label with the text "Textbox Label:" and a textbox with the default value of "0". The textbox can be amended by the user.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top