Assign hidden field value in textbox onblur asp.net using server tag

  Kiến thức lập trình

Using the server tag, I must give the value of the hidden field to the javascript method in the textbox onblur event inline.

                        <asp:HiddenField ID="hdnMaxLen" runat="server" Value="10" />

                        <asp:TextBox ID="txtTargetForBelow6" runat="server" MaxLength="10"
                        onkeyup="return FnAlert(this,"+ <%# hdnMaxLen.Value %> +");"
                        CssClass="form-control" AutoCompleteType="None" autocomplete="off"></asp:TextBox>

It shows an error like

The server tag is not well formed.

LEAVE A COMMENT