I don't think that would be an issue with II6 or IIS7, I would honestly think that it would be a locale issue. Your code runs fine for me in IIS 7 and IIS 7.5. If you write out
System.Globalization.CultureInfo.CurrentCulture.ToString what does it print out?
First off, thank you very much for answering my post.
I checked the globalisation culture on my 2008 server as well on all my other servers. They are all en-ZA.
But you are absolutely right: as soon as i change the culture to en-US on the 2008 box using my web.config, it works like a dream.
Further investigation shows that en-ZA has changed in 2008 in that it has a space as a Digit Grouping Symbol. They have effectively broken it.
Is it possible to use a custom grobalisation culture: based on en-ZA, but that uses commas in staid of spaces for digit grouping, or to edit the globalisation culture?
Anyways - thanks a billion for helping out. I can use the en-US for the time being (except that it will display $ in staid of R). All my currency compare validators work fine all of a sudden.
This has saved me from having to redevelop every one of to my currency compare validators to use Regular Expression Validators and all from having to commas in my code.
Zenithsurfer
0 Points
2 Posts
Is this an IIS 7 issue?
May 19, 2009 09:04 AM|LINK
Howdy,
I have the same (very basic) code that i run on each of my 3 servers:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Try
Dim strAmt As String = "100,000,000"
Dim i As Integer = CInt(strAmt)
Response.Write(i)
Catch ex As Exception
Response.Write(ex.ToString)
End Try
End Sub
Of the 3 servers 2 of them are Windows 2003 (x64) server ans one is a Windows 2008 (x64)
The 2003 servers write a value of 100000000 (eg http://test.lightstone.co.za/tmp.aspx)
The 2008 server, however, comes up with an error (http://preprod.lightstone.co.za/tmp/tmp.aspx):
System.InvalidCastException: Conversion from string "100,000,000" to type 'Integer' is not valid.
The regional settings on all 3 servers is identical.
Is this an issue with IIS 7 and ,if so, how does one solve it?
vcsjones
All-Star
34840 Points
4423 Posts
Moderator
MVP
Re: Is this an IIS 7 issue?
May 20, 2009 02:21 AM|LINK
I don't think that would be an issue with II6 or IIS7, I would honestly think that it would be a locale issue. Your code runs fine for me in IIS 7 and IIS 7.5. If you write out System.Globalization.CultureInfo.CurrentCulture.ToString what does it print out?
Zenithsurfer
0 Points
2 Posts
Re: Is this an IIS 7 issue?
May 20, 2009 06:03 AM|LINK
Hi There,
First off, thank you very much for answering my post.
I checked the globalisation culture on my 2008 server as well on all my other servers. They are all en-ZA.
But you are absolutely right: as soon as i change the culture to en-US on the 2008 box using my web.config, it works like a dream.
Further investigation shows that en-ZA has changed in 2008 in that it has a space as a Digit Grouping Symbol. They have effectively broken it.
Is it possible to use a custom grobalisation culture: based on en-ZA, but that uses commas in staid of spaces for digit grouping, or to edit the globalisation culture?
Anyways - thanks a billion for helping out. I can use the en-US for the time being (except that it will display $ in staid of R). All my currency compare validators work fine all of a sudden.
This has saved me from having to redevelop every one of to my currency compare validators to use Regular Expression Validators and all from having to commas in my code.
You are DA MAN!!
Eugene
.