I'm not entirely sure what the problem is, but I've attached a sample project where you can see it in action. The sample doesn't make a whole lot of sense on its own, but I have taken parts out of a larger project where this exact functionality is needed.
I am using the ASPxMenu control with some of the items being checked or not. Checking the first item will disable the second item and clicking the third item will disable the fourth. The state of these items is saved in Session variables. This setup is working perfectly on initial page load where all the states are set to true. However, if you uncheck number one, for instance, then it automatically disables number two - which works great. However, if you then reload the page you'll see that all the states are reloaded, but number two is disabled (as it should be) but it is not using the disabled image (it's using the checked image). Clicking number one enables number two (correctly), but now the control is using the unchecked image. Clicking it now uses the checked and disabled images (rather than the checked and unchecked images).
The problem seems to be coming from setting both checked=true and then clientenabled=false from the code behind. Since the client side can remember the checked state (regardless of how many times it is enabled or disabled), why can't I specify this state ahead of time in the code behind? This seems like a bug that is causing some weird behavior.
Is your intention to post an answer to your own question?
- If so, then proceed.
- If you simply wanted to post additional information, ask for further clarification, or to just say "Thanks!", please click Leave a Comment.
- If you wish to edit your original question, please use the Edit button in the Toolbox at the top right corner of that entry.