Jun
24th | 2008

How Do You Exit Your .Net Application?

Posted by Shahar Y |
Filed under .Net, C# |

image

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:

  • Do you use Application.Exit or Environment.Exit?
  • Where do you call the exit method?

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...
May
23rd | 2008

XHTML Sitemap Validation Tool 1.1 Version Released

Posted by Shahar Y |
Filed under .Net, Misc., Utilities, WPF |
imageXHTML sitemap validation tool allows you to XHTML validate your entire sitemap in one click, unlike the W3C markup validation service that let you validate one page at a time. This tool is also needed because XHTML validation is very important in the manner of SEO.
 
After releasing it a few days ago, Rob White from http://www.jacquelinewhite.co.uk/ wrote us that he had problems validating his site. Checking that issue, we found out that the default namespace on Robs sitemap is different than what we expected. During this bug fix, some other issues came up and we decided to release version 1.1 of our tool. The update includes:


Continue Reading...
May
20th | 2008

Validate Your Entire Web Site With This Free Open Source WPF XHTML Validation Tool

Posted by Amit |
Filed under .Net, WPF |

XHTML Validation Tool 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...
May
7th | 2008

Why Should You Wrap Your ASP.NET Session Object

Posted by Shahar A |
Filed under .Net, ASP.Net, C# |

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...

Search Dev102