Hi All,
I have 2 more easier questions I would like to ask:
1. How in code do you set a textbox on an ASP.NET page to get focus? (I have looked on the web and such also used the intellisense but no luck)
2. How do I format a string to currency? (So that if there is any decimal values they are always 2 decimal places or if there is no decimal values show no decimal places)
I have had two attempts:
These work in as much as they only allow 2 decimal places maximum, however they would display £10.10 as £10.1. How can I avoid this?
Many thanks, Dave.
I have 2 more easier questions I would like to ask:
1. How in code do you set a textbox on an ASP.NET page to get focus? (I have looked on the web and such also used the intellisense but no luck)
2. How do I format a string to currency? (So that if there is any decimal values they are always 2 decimal places or if there is no decimal values show no decimal places)
I have had two attempts:
Code:
lblQuote.Text = "Charge for walls = £" + String.Format("{0:C}", Convert.ToString(wallCost))
Code:
lblQuote.Text = "Charge for walls = £" + String.Format("{0:F2}", Convert.ToString(wallCost))
Many thanks, Dave.