ASP.NET Menu control caches menu items


I’ve been creating a new Web application in ASP.NET 4 by using Visual Studio 2010 Beta, and the Menu control is so much better, now that it natively supports CSS styling without rendering HTML table elements. However, I implemented localization functionality to let the user be able to change the culture, by clicking an icon with a flag. This worked great for all of the controls, except for the Menu control. For some reason it kept the previously selected culture, while on the same page. Going to another page immediately changed the culture of the Menu control as well. While it was pretty obvious what was going on, I have to admit that it took quite a few minutes to work it out; viewstate had to be disabled for the Menu control, and right I was. 🙂

Advertisements