There is alot of people complaining that asp.net mvc looks a lot like classic asp.And it does ...but that can be seen as an advantage, since that are stilllots of applications writen in classic asp and in my point of view using the mvc framework would make the migration easier.
Showing posts with label tip. Show all posts
Showing posts with label tip. Show all posts
Monday, July 28, 2008
Wednesday, April 09, 2008
Turkey test your code
Today I found a very interesting post about handling different cultures.
From now own I will be sure to apply the Turkey test to my code.
As a complement here is how to use .net code to pick-up the browser culture and use it.
Threading.Thread.CurrentThread.CurrentCulture = Globalization.CultureInfo.CreateSpecificCulture(HttpContext.Current.Request.UserLanguages(0))
From now own I will be sure to apply the Turkey test to my code.
As a complement here is how to use .net code to pick-up the browser culture and use it.
Threading.Thread.CurrentThread.CurrentCulture = Globalization.CultureInfo.CreateSpecificCulture(HttpContext.Current.Request.UserLanguages(0))
Tuesday, November 06, 2007
C# Gotcha
Look at the code below..do you see anything wrong?
Object x=2;
double y=(double)x;
Now try to execute it ..and surprise ,surprise it throws a exception...
Looking only at this two lines makes it easier to see the problem..but imagine
this in the middle of a very big code and the error only happening at your production server
(that's what happened to me...) I had to take a wild guess at what was wrong
and I changed the code to
y=Double.parse(x);
..
Now the code works.
Object x=2;
double y=(double)x;
Now try to execute it ..and surprise ,surprise it throws a exception...
Looking only at this two lines makes it easier to see the problem..but imagine
this in the middle of a very big code and the error only happening at your production server
(that's what happened to me...) I had to take a wild guess at what was wrong
and I changed the code to
y=Double.parse(x);
..
Now the code works.
Powered by ScribeFire.
Subscribe to:
Posts (Atom)