How to change a public variable value?

S

Shapper

Hello,

I have this:

Public Class index

Inherits System.Web.UI.Page
Public readMore As String
...

Private Sub ShowNews()
...
Select Case Session("culture")
Case "pt-PT"
readMore = "Lêr Mais"
Case "en-GB"
readMore = "Read More"
End Select
...
End Sub

End Class

The variable readMore is not changing its value. Why?

Thank You,
Miguel
 
G

Guest

I would aim for looking at what Session("culture") holds, as that is an
issue. You can set a default for the switch (Select Case).

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
 
S

Shapper

Ouputs "pt-PT". I even placed a Reponse.Write inside the Case statement
and it's working fine. I have no idea why I am not getting the value in
my aspx page when I write <%# readMore %>

Does anyone knows why is that?

Thank You,
Miguel
 
T

TJS

your select code looks fine

Is the session value changing correctly?
Is readmore a variable scoped at the page level, function level ???
 
S

Shapper

Hi,

The problem was in <%# readMore %>.

Now I have <%= readMore %>. It's working fine.

Thanks,
Miguel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top