473,473 Members | 1,714 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

ASP C# Itemtable cell money format

Daxthecon
63 New Member
Hey guys long time no see. Anyway I was asked to take care of a small issue with one of the item tables I worked on. The issue is that they want it to autoformat to ####.## if applicable. Such as if they just put in 2342 and no "." then the code formats it in there for them adding .00 to the end.

I have searched the net and haven't come up with a solution that caters to my needs. I've found move this around and such but never the completely right solution. If anyone's got an idea to where to find the answer or has an example of the answer I'd be more than appreciated. Thank you for your time.
Oct 9 '08 #1
8 1708
Frinavale
9,735 Recognized Expert Moderator Expert
Check out the AJAX Toolkit's FilteredTextBox. If this doesn't suit your needs you're probably going to have to write some JavaScript and apply it to the text box to filter/mask the user's input.

-Frinny
Oct 9 '08 #2
Daxthecon
63 New Member
Is the js method used via putting it in via the asp as a getelementid or how is that put in. I've never had to ues ASP to do this. So I'm a little new to this method.
Oct 9 '08 #3
Frinavale
9,735 Recognized Expert Moderator Expert
Is the js method used via putting it in via the asp as a getelementid or how is that put in. I've never had to ues ASP to do this. So I'm a little new to this method.

If you create your own JS to filter the TextBox data you could pass the whole textbox into the function...so that you don't have to use the getElementByID method (that's what I'm assuming you were trying to say?).

I'm not exactly sure what you're asking.

-Frinny
Oct 9 '08 #4
Daxthecon
63 New Member
Would I put the javascript into the ASP code at the top and call the element id and then apply the filter to it?
Oct 9 '08 #5
Frinavale
9,735 Recognized Expert Moderator Expert
Would I put the javascript into the ASP code at the top and call the element id and then apply the filter to it?

Ok I take it that the FilterControl is not acceptable for you.

There are a number of different ways to go about adding the JavaScript to your ASP code. You could write an external JS file and include it in your <head> section.

Check out this article on how to check if a text box contains a number.

The article does not mention any use of ScriptManagers or ScriptManagerProxies as it was written before these became main stream.

If you are using a ScriptManager in your application let me know and I'll see if I can help step you through the process.

-Frinny
Oct 9 '08 #6
Daxthecon
63 New Member
I'm only familiar with putting <script>jarble</script> on top of the ASP.NET Page. Like I said I am realy new to this ASP.net Javascript business.
Oct 9 '08 #7
Frinavale
9,735 Recognized Expert Moderator Expert
I'm only familiar with putting <script>jarble</script> on top of the ASP.NET Page. Like I said I am realy new to this ASP.net Javascript business.

Welcome to the fun side of life :D


Anyways, did you create an Ajax Enabled web site?
If so I think it'd be easiest for you to use the Ajax Tool Kit that I linked you to...this would require the least amount of work.

If not, just put the JavaScript code in <head> section of the page for now so that you can get this done quickly. Use the concepts outlined in the "how to check if a textbox contains a number" article to apply your JavaScript to your TextBox. (Remember to pass the ClientID of the TextBox to the function if your JS function is using the GetElementByID method....)

If you get stuck, post what you've tried so far.

-Frinny
Oct 9 '08 #8
Daxthecon
63 New Member
Ok will do. Thank you very much for your help.
Oct 9 '08 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

24
by: Batista, Facundo | last post by:
Here I send it. Suggestions and all kinds of recomendations are more than welcomed. If it all goes ok, it'll be a PEP when I finish writing the code. Thank you. .. Facundo
5
by: nivas.meda | last post by:
Hi, I have an excel sheet with a graph and cells.If i change the value in the excel cells the graph will reflect.Now i am going to implement this functionality in html page.I successfully saved...
2
by: Alberto | last post by:
I have a decimal field in a SQL Server DataBase who stores money and I want to show it in a TextBox and in a ListView controls in C#. If I do: txtMoney.Text = Convert.ToSingle(dr); I see...
3
by: Tim::.. | last post by:
Hi, I keep getting the following error in my code: System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. Parameter name: index I presume it is because...
2
by: DraguVaso | last post by:
Hi, I'm looking for a nice way to format the cell of my datagrid according to some predefined 'rules'. I found a lot on the site of George shepherd, but it wasn't really what I was looking for:...
3
by: Mad Scientist Jr | last post by:
Can someone post a clear example of how to change the background color of an individual datagrid cell for a Windows desktop app? (preferably in vb.net) I found some code on how to do this when...
2
by: Brian Parker | last post by:
I need to format text in cell in an Excel worksheet and I need to do this using C#. I've seen code that will set the format for the whole cell, but I just need to format one character in that...
17
by: Grant Kelly | last post by:
I'm wondering if it's possible within HTML markup (or possibly CSS) to specify that an HTML table's headers should be placed 'over' the cell borders rather than 'within' the cells. For example...
1
by: stevenpkent | last post by:
I need to allow user to save dataset to their computer in Microsoft Money format. I searched internet for help on this but found nothing helpful. I also chatted with MS Online Concierge to no...
3
by: chris f | last post by:
In my table (ASP.NET 2) that is dynamically generated I have a cell that initially will only display N rows of text and hide the rest. (This is so that the rows have a small height and I can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.