Adding TextBox with default value


Joined
Jan 13, 2023
Messages
1
Reaction score
0
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
 
Ad

Advertisements

Joined
Jan 8, 2023
Messages
21
Reaction score
1
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

Top