Welcome to imar.spaanjaars.com

image
Welcome to the personal web site of Imar Spaanjaars where I write about software development with a focus on Microsoft web technologies
Image representing the Blogs category

Got the MVP Award Again!!

Published 14 years ago

Woohoo, I've received the MVP Award again....

Read on ...
Image representing the Articles category

Automatically Generating Class Diagrams from a Type Using Reflection

Published 14 years ago

Before I launched my web site www.dotnetattributes.com in early 2009 I generated most of the content automatically using reflection and web look ups. I extracted all the various attributes from .NET assemblies using the Managed GAC API Wrappers and I extracted a lot of class details and documentation from the MSDN site using the HttpWebRequest class. One thing I hadn't automated at first and was planning to do manually using Visual Studio was generating class diagrams. However, soon after the first full import attempt I ended up with more than 1,200 attributes so manually creating the diagrams suddenly did not seem so attractive anymore.

Read on ...
Image representing the Blogs category

Book Review: ASP.NET 3.5 Content Management System Development by Curt Christianson and Jeff Cochran

Published 14 years ago

Since I work a lot with ASP.NET and work in the business of Content Management Systems in my job as Technical Director at Dynamicweb, I was immediately interested when I saw the book "ASP.NET 3.5 Content Management System Development" from Packt Publishing. So I ordered a review copy hoping for a great book on ASP.NET and CMS. Having read the book now, I am quite disappointed.

Read on ...
Image representing the Articles category

How to handle the error "The specified string is not in the form required for an e-mail address."

Published 14 years ago

Recently I saw a number of people (a colleague and some readers of my book Beginning ASP.NET 3.5 in C# and VB) run into an ASP.NET error indicating that the "specified string is not in the form required for an e-mail address". This error is quite common and usually pops up when developers or end users are supplying a value that doesn't match the syntax rules for an e-mail address. However, in the recent cases I saw this error popped up at the moment a new MailMessage class is constructed. That means the code crashed even before it tried to assign an e-mail address to one of the To, CC, Bcc or From properties through code. So what happened?

Read on ...
Image representing the Articles category

Proper Handling of 404 Errors Using redirectMode

Published 14 years ago

ASP.NET has a handy feature that lets you easily determine an error page that gets displayed in case an error occurs on your server. Using the customErrors section in the web.config file you can assign specific pages that are displayed for specific HTTP error codes. The following example shows how 404 errors (page not found) and 500 errors (server errors) are routed to the file ~/Errors/Error404.aspx and ~/Errors/Error500.aspx respectively. All other errors are handled by the generic ~/Errors/Error.aspx page:

<customErrors mode="On" defaultRedirect="~/Errors/Error.aspx">
  <error statusCode="404" redirect="~/Errors/Error404.aspx" />
  <error statusCode="500" redirect="~/Errors/Error500.aspx" />
</customErrors>

Although easy to use and set up, this solution has some drawbacks that might impact how search engines see your site and how 404 errors are treated. The good news is: these problems can easily be overcome.

Read on ...
Image representing the Articles category

Using a Local Pickup Folder for Email Delivery

Published 14 years ago

Many of the web applications I build make use of e-mail somehow. Whether it's the ASP.NET Membership services that send out account confirmations or reset passwords, or some custom logic that sends out e-mail, I typically used an SMTP server on my local network or one from an ISP. However, using a remote server isn't the fastest nor most secure way to send mail.

Read on ...
Image representing the Blogs category

Drag and Drop of Files from Windows to Visual Studio not Working?

Published 14 years ago

Do you ever drag and drop files from a Windows Explorer into Visual Studio running on Windows Vista? And have you noticed that sometimes it works, and sometimes it doesn't? When it doesn't work, Visual Studio shows the "stop" icon when you drag the files over the Solution Explorer. I ran into that issue a lot and it was driving me nuts....

Read on ...
Image representing the Articles category

Checking the Existence of an ASP.NET Membership Username with ASP.NET AJAX

Published 14 years ago

If you have been using the Membership features that ship with ASP.NET, I'm sure you're familiar with the CreateUserWizard control that lets a user sign up for an account on your site. One of the features of this control (in cooperation with the Membership services) is to check whether a given user name is already taken and display an appropriate message if that's the case. This is an excellent feature as it makes sure no two users can end up with the same user name.

One of the problems with this check is that it takes place at the server. This means the page goes through a full post back which takes some time. Even worse, due to security settings on the control, the two password fields are reset so the user has to enter them again in case they chose an existing user name. It would be a lot easier if you could check the user name before the page is posted back using a bit of client side script. With ASP.NET AJAX and Page Methods, this is a walk in the park.

Read on ...
Image representing the Articles category

Extending ValidationBase to Validate Properties of Type ValidationBase

Published 15 years ago

A couple of days ago I got an e-mail from Maarten van der Lee with some code that can be used in my Validation Framework of my N-Layer Design article series to validate sub properties whose type is a ValidationBase as well. This can be useful if you want to present a full list of validation errors for an object and its properties.

Read on ...
Image representing the Blogs category

7 Signs You Are Addicted to CodeRush and Refactor!

Published 15 years ago

I am a big fan of CodeRush and Refactor! from DevExpress and have been one for quite some time. In my office we jokingly refer to CodeRush and Refactor as the "arrow guy" as my colleagues initially just saw a bunch of arrows pointing to code in my code editor when I gave a first demo of the product. But, obviously, the products do a lot more. They really make me more productive in writing .NET code. But better yet, they help me write good, optimized and organized code. Features like renaming code elements, renaming files to match the type they contain, optimizing namespaces, extracting methods and the many new refactorings that come with the new "Code Issues" feature are huge time savers. Recently I installed the latest version that comes with DXperience 9.1.3. This release includes many cool new refactorings and new features in Code Issues that help you optimize your code with a single click. I can really recommend downloading a trial version and see for yourself if you haven't already done so.

But lately I am wondering if I am not just a fan, but addicted to the products instead. I witnessed the following signs of addiction while working with computer programs in general:

Read on ...

Mobile: False

Crawler: True

I: False