Why are string constants null on postback?

B

Brad Wood

I have a global struct with some string constants in it like:

public struct SOME_CONSTANTS
{
public const string DUDE = "killer";
public const string SWEET = "righteous";
}

This is accessible fine when the page is first called, but on postack,
this struct shows null. ???
 
G

Guest

Are you saying you're looking at the struct member in the debugger and it
shows null, or is it actually null when you try to do something with it?

The former is a known problem with the VS.NET debugger. It shows null for
static/const struct members under some circumstances.

If that's not the case then you definitely have a problem =)
 

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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top