The word static means something different depending on what environment you are in, but in this case I refer to static as in a local variable that retains its value between function calls (inside a particular function). I know this exists in VB, but in Javascript I haven't yet figured out how to implement it.
I know, It's a rare thing that you would use something like this, but I have come into a situation that I need to use a static variable (in the VB sense).
I have this calendar that when you display it it works as you would expect and it gets you the date to put in the textbox. The problem is if you need to go to the next month, it triggers a postback, since it is a part of that page (it is a server side calendar control). As you would expect, the page is reloaded and the calendar disappears.
If I could set a "flag" in a function that would keep its value each time that function was called, that would work. I have tried a global variable, but that won't work either, because I only want to reset the variable under certain conditions when the function is called.
It would work OK if the I started out with the calendar being displayed on the first load, then it doesn't go away with every postback. But I don't want it to display the first time the app is loaded. So what I need is some way to set a flag that doesn't get reset on every postback.
I know, It's a rare thing that you would use something like this, but I have come into a situation that I need to use a static variable (in the VB sense).
I have this calendar that when you display it it works as you would expect and it gets you the date to put in the textbox. The problem is if you need to go to the next month, it triggers a postback, since it is a part of that page (it is a server side calendar control). As you would expect, the page is reloaded and the calendar disappears.
If I could set a "flag" in a function that would keep its value each time that function was called, that would work. I have tried a global variable, but that won't work either, because I only want to reset the variable under certain conditions when the function is called.
It would work OK if the I started out with the calendar being displayed on the first load, then it doesn't go away with every postback. But I don't want it to display the first time the app is loaded. So what I need is some way to set a flag that doesn't get reset on every postback.