Web Textbox

R

Rene Fehr

Hi all

i need to format a simple textbox in a webform. i already
know how to align for example text (style="text-align:
right;") now i need a numeric format for the textbox as
like
"#,##0.00". does anybody know how to do that? either with
code behing or in HTML?

thank you in advance

Rene
 
E

Ed Kaim [MSFT]

Try using a RegularExpressionValidator. It'll require the roundtrip, but
it's easy to do without any code.
 
G

Guest

Thanks for that.

all i want to do is to mask the values in the textbox, i
don't need to validate the values. i am looking for a
solution like in a Datagrid where you can use
Databinder.Eval

text='<%# DataBinder.Eval
(Container.DataItem, "DebBetrag", "{0:#,##0.00}") %>'

this is a valid syntax, but nothing happens with the
statement below.

txtBudget.Text.Format("#,##0.00", txtBudget)

what is wrong here?

Regards,

Rene
 
S

Scott M.

Have you looked at passing the textbox value into a numeric data type
variable and then using the FormatNumber function on that variable?
 
G

Guest

this is what i need

i did it the following way and it works

txtBudget.Text = FormatNumber(txtBudget.Text, -1,
TriState.True, TriState.True, TriState.True)


thanks a lot

Rene
 

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