S
Shapper
Hello,
I have this code:
[1] Dim cultureList(,) As String = {{"E", "en-GB"}, {"P", "pt-PT"}}
[2] Select Case Session("culture")
[3] Case "pt-PT"
[4] ...
[5] Dim cultureList(,) As String = {{"E", "en-GB"}, {"P", "pt-PT"}}
[6] Response.Write("1")
[7] Case "en-GB"
[8] ...
[9] Dim cultureList(,) As String = {{"E", "en-GB"}, {"P", "pt-PT"}}
[10] Response.Write("2")
[11] Case Else
[12] Dim cultureList(,) As String = {{"E", "en-GB"}, {"P", "pt-PT"}}
[13] Response.Write("3")
[14] End Select
[15] ddlculture.DataSource = cultureList
[16] ddlculture.DataBind()
Something very strange is happening:
If I declare cultureList in line [1] and delete the lines [5], [9] and
[12] everything works fine. However, if I declare the string inside the
case, i.e., I keep lines [5], [9] and [12] but delete the line [1] I get
an error on line [15] saying: "Name 'cultureList' is not declared."
Why is this? Isn't this strange?
And yes the case is working. That is why I have the Response.Write
lines.
Thanks,
Miguel
I have this code:
[1] Dim cultureList(,) As String = {{"E", "en-GB"}, {"P", "pt-PT"}}
[2] Select Case Session("culture")
[3] Case "pt-PT"
[4] ...
[5] Dim cultureList(,) As String = {{"E", "en-GB"}, {"P", "pt-PT"}}
[6] Response.Write("1")
[7] Case "en-GB"
[8] ...
[9] Dim cultureList(,) As String = {{"E", "en-GB"}, {"P", "pt-PT"}}
[10] Response.Write("2")
[11] Case Else
[12] Dim cultureList(,) As String = {{"E", "en-GB"}, {"P", "pt-PT"}}
[13] Response.Write("3")
[14] End Select
[15] ddlculture.DataSource = cultureList
[16] ddlculture.DataBind()
Something very strange is happening:
If I declare cultureList in line [1] and delete the lines [5], [9] and
[12] everything works fine. However, if I declare the string inside the
case, i.e., I keep lines [5], [9] and [12] but delete the line [1] I get
an error on line [15] saying: "Name 'cultureList' is not declared."
Why is this? Isn't this strange?
And yes the case is working. That is why I have the Response.Write
lines.
Thanks,
Miguel