Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / July 2005

Tip: Looking for answers? Try searching our database.

Why are string constants null on postback?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Brad Wood - 15 Jul 2005 21:14 GMT
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.  ???
Klaus H. Probst - 15 Jul 2005 21:43 GMT
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 =)

Signature

Klaus H. Probst, MVP
 http://www.simulplex.net/

> I have a global struct with some string constants in it like:
>
[quoted text clipped - 6 lines]
> This is accessible fine when the page is first called, but on postack,
> this struct shows null.  ???

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.