473,385 Members | 1,582 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How to change a public variable value?

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
Nov 19 '05 #1
5 1153
TJS
output the value of session("culture") and see what it is sending
"Shapper" <mdmoura*NOSPAM*@gmail.*DELETE2SEND*com> wrote in message
news:OS*************@TK2MSFTNGP12.phx.gbl...
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

Nov 19 '05 #2
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!
***************************
"Shapper" wrote:
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

Nov 19 '05 #3
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

"TJS" <no****@here.com> wrote in message news:no****@here.com:
output the value of session("culture") and see what it is sending
"Shapper" <mdmoura*NOSPAM*@gmail.*DELETE2SEND*com> wrote in message
news:OS*************@TK2MSFTNGP12.phx.gbl...
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


Nov 19 '05 #4
TJS
your select code looks fine

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

"Shapper" <mdmoura*NOSPAM*@gmail.*DELETE2SEND*com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
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

"TJS" <no****@here.com> wrote in message news:no****@here.com:
output the value of session("culture") and see what it is sending
"Shapper" <mdmoura*NOSPAM*@gmail.*DELETE2SEND*com> wrote in message
news:OS*************@TK2MSFTNGP12.phx.gbl...
> 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
>
>

Nov 19 '05 #5
Hi,

The problem was in <%# readMore %>.

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

Thanks,
Miguel

"Cowboy (Gregory A. Beamer) - MVP" <No************@comcast.netNoSpamM>
wrote in message news:No************@comcast.netNoSpamM:
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!
***************************
"Shapper" wrote:

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


Nov 19 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Richard Cornford | last post by:
For the last couple of months I have been trying to get the next round of updates to the FAQ underway and been being thwarted by a heavy workload (the project I am working on has to be finished an...
0
by: Anonieko Ramos | last post by:
Answer. Use IHttpHandler. thanks Ro ry for coming up with this code. It processes css file to add variables. neat idea using System; using System.IO; using System.Text; using...
3
by: Tom | last post by:
I am writing a Visual basic .Net database application. There are many forms that first let you select and look at a DB record and then when you click a "modify" button you are allowed to change...
45
by: Zytan | last post by:
This returns the following error: "Cannot modify the return value of 'System.Collections.Generic.List<MyStruct>.this' because it is not a variable" and I have no idea why! Do lists return copies...
3
by: tc | last post by:
I'm trying to put together a small control. It's not, but for arguments sake, let's say it's a progress bar. The user will make a change to a setting, lets call it 'value'. I want to trap the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.