You must Sign In to post a response.
  • Category: ASP.NET

    REgarding validation error message

    I have the following code in and i want to display the error message inside the textbox. How to do that.

    <div class="panel-body">
    <div class="col-md-3 col-md-3">
    <!-- this is added by me -->
    <div class="form-group">
    <div class="input-group">
    <div class="input-group-addon"><span class="glyphicon glyphicon-user"></span> </div>
    <asp:TextBox ID="txtLrNo" CssClass="form-control" placeholder="Enter LR. No" runat="server">

    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" CssClass="Validators"
    Display="Dynamic" ControlToValidate="txtLrno" ForeColor="#FF0000" runat="server" ErrorMessage="Lr No is Required."></asp:RequiredFieldValidator>



    <!-- upto here -->
  • #769022

    I don't think so error or validation message will display in inside controls...!

    Usually it would display separate, I guess you want WaterMark to the text control? like "Enter LR No" inside textbox if yes then I suggest you to use AJAX WaterMarkExtender control this will help you to show the watermark by default to your textbox.


    <asp:TextBox ID="txtFstName" runat="server" CssClass="unwatermarked"></asp:TextBox>
    <ajaxToolkit:TextBoxWatermarkExtender ID="tbwe" runat="server" TargetControlID="txtFstName"
    WatermarkText="Enter First Name" WatermarkCssClass="watermarked"></ajaxToolkit:TextBoxWatermarkExtender>
    <br />

    Refer below link if you want to know more details on how to use WaterMarkExtender Control.

    Hope this helps you...

    Give respect to your work, Instead of trying to impress your boss.

    Blog :

  • Sign In to post your comments