Re: Float to string conversion in C#
- From: "mishj" <mishj@xxxxxxxxx>
- Date: 18 Feb 2006 08:21:46 -0800
Well I worked it out in the end - because I was returning the result of
a Yahoo! maps api call (which is definitely a float type) into the text
field fromLat before the call to float.Parse, I had assumed that the
value was at that point "in" the text field. It turns out that until
the server side code completes, the textfield doesnt seem to actually
"get" the value passed into it, so at the point I was calling the
float.Parse the text field had nothing in it, even though I do nothing
to change it between then and when the textfield appears on the screen
with the float value clearly inside the text field. Seems rather
bizarre behaviour, but I had never used c# server side code behind an
asp.net page before this so I didnt understand how the text fields were
assigned values.
Sorry - I guess I should have checked beforehand that the float value
really was in this.fromLat.Text!! ;-)
Having said that, the error message completely threw me, and I dont
like the error message given what I was trying to do - it was nothing
to do with DateTime types, so no wonder I was totally confused!
Microsoft should come up with something better than that I feel. Why
do they assume that a float is a DateTime????
Thanks again guys..
.
- Follow-Ups:
- Re: Float to string conversion in C#
- From: Stephany Young
- Re: Float to string conversion in C#
- References:
- Float to string conversion in C#
- From: mishj
- Re: Float to string conversion in C#
- From: mishj
- Re: Float to string conversion in C#
- From: Jon Skeet [C# MVP]
- Float to string conversion in C#
- Prev by Date: anyway to create a packet sniffer
- Next by Date: More Master/Detail question
- Previous by thread: Re: Float to string conversion in C#
- Next by thread: Re: Float to string conversion in C#
- Index(es):
Relevant Pages
|