I have a ASP.Net
Web Form
TextBox
Control that I am able to change its text format formula to the currency formula but this happens after the user enter the number and causing a postback by method OnTextChanged()
, but I need this to happen at real time.
Meaning: I need this to happen while user is writing without Postback
? So should I write an extension method for this?
<asp:TextBox ClientIDMode="AutoID" onkeypress="CheckValueEntered(event);" runat="server" AutoPostBack="true" Text="0" OnTextChanged="plusEnteredAmount" ID="txtAmount" placeholder="المبلغ" CssClass="form-control a"></asp:TextBox>
and below I am changing the text formula on code behind
txtAmount.Text = enteredAmount.ToString("#,##0", CultureInfo.InvariantCulture);