The question in the title does not refer to the actions you take when you are about to exit your application, issues like logging, closing file handles, freeing unmanaged resources and so on. It does literally refer to the exit action itself:
The idea for that post came to my mind after I had to solve a weird bug where pressing the Exit button led to a freeze in an application that I work on. It turned out that I was not using the proper Exit method although I was aware to the fact that there are 2 possibilities. Sometimes, when you are in a middle of a coding momentum, writing a lot of code, you can miss the little details. Those will come back to hunt you later on, and the most difficult thing about it is that everything was functioning fine for about a year before the bug showed his ugly face.
Lets first understand the difference between the 2 Exit methods:
Continue Reading...
During the past couple of weeks we noticed that whenever we tweak our theme or change something in one of our posts, it causes some pages to become XHTML invalid. We came to think that you never know where it is going to hit you, so we sat down and created a small application which helps you keep all your pages XHTML valid. We checked it on our sitemap, and seems we have some HTML work to do :).
This application is written in WPF and is based on the .Net Framework 3.5.
It will allow you to validate you entire sitemap in one click. The validation is done through the W3C validation SOAP service, so you can trust it :).
Continue Reading...
ASP.NET provides mechanisms for storing information for a single user session or across multiple sessions. This is done using the HttpSessionState and HttpApplicationState classes. The Page class has Application and Session attributes to provide access to current objects. The simple way to access them is as following:
if (Session["FirstName"] == null)
{
LabelFirstName.Text = “FirstName”;
}
else
{
LabelFirstName.Text = (string)Session["FirstName"];
}
if (Session["LastName"] == null)
{
LabelLastName.Text = “LastName”;
}
else
{
LabelLastName.Text = (string)Session["LastName"];
}
Continue Reading...