Monday, March 12, 2012

Why this code line doenst work?

Hello,
I have the following code in the Global.asax:
Sub Session_Start(Sender As Object, E As EventArgs)
Thread.CurrentThread.CurrentCulture = New CultureInfo("en-US")
End Sub
The Error I get: "Name 'Thread' is not declared."
However when I have this in my aspx code it works:
Sub Page_Load(Sender As Object, E As EventArgs)
Thread.CurrentThread.CurrentCulture = New CultureInfo("pt-PT")
End Sub
Why?
Can't I set the culture in the Global.asax?
Thank You,
Miguel

Have you add

Imports System.Threading statement in your code


Of Course. I forgot the dam line.
Thanks,
Miguel

0 comments:

Post a Comment