If you want to have textboxes which format the text entered or prevent users from entering just anything, use MaskedTextBox from AjaxToolkit or use javascript to format the text client side.
Otherwise, create formatting function that takes TextBox control and formats its text. You can use it in TextChanged event, but you have to create event handler for each textbox.
In your page
<asp:textbox id="TextBox1" runat="server" width="180px" autopostback="True" xmlns:asp="#unknown">
ontextchanged="TextBoxChanged_Handler">0</asp:textbox>
<asp:textbox id="TextBox2" runat="server" width="180px" autopostback="True" ontextchanged="TextBoxChanged_Handler" xmlns:asp="#unknown">0</asp:textbox>
Code behind:
protected TextBoxChanged_Handler(object sender, EventArgs e) {
FormatText(sender);
}
private void FormatText(TextBox txt) {
txt.Text = string.Format("{0:0,0}", double.Parse(txt));
}
You should rename your controls to something sensible.
If this helps, please take time to accept the solution. Thank you.