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

Renewed as a Microsoft MVP Again!

Published 9 years ago

Today I received the following e-mail from Toby Richards, General Manager of Community & Online Support at Microsoft:

Congratulations! We are pleased to present you with the 2011 Microsoft® MVP Award! This award is given to exceptional technical community leaders who actively share their high quality, real world expertise with others. We appreciate your outstanding contributions in ASP.NET/IIS technical communities during the past year.

The Microsoft MVP Award provides us the unique opportunity to celebrate and honor your significant contributions and say "Thank you for your technical leadership."

Read on ...
Image representing the Articles category

Using Entity Framework Code First and ASP.NET Membership Together

Published 9 years ago

Some time ago I was involved as a software designer and developer in an MVC 3 project that used Entity Framework Code First 4.1 in a repository layer. During development we postponed dealing with security as requirements were pretty simple (simple logons with a single Administrators role plus the requirement that users should only be able to see their own data). When we were close to deployment, we ran the aspnet_regsql tool against the database that EF had created for us to create the SQL schema and data that the Application Services such as Membership and Roles require. We also added an additional userName parameter to a Get method in the repository to filter records for the currently logged in user. Finally, we added Authorize attributes to a number of controllers to make sure they are only accessible for users that are logged in. We then deployed the application and database, created a number of users using the MvcMembership section we had added to the site, and announced the presence of the site. All of this worked great, but we ran into issues when started work on the next version of the application.

Read on ...
Image representing the Articles category

Creating Checkboxes that Behave Like Radio Buttons with jQuery

Published 9 years ago

Some time ago I received a question on the Wrox P2P forum about checkboxes that should behave like radio buttons. The poster of the question was looking for a (client side) solution to have multiple checkboxes per row in a GridView with multiple rows. A user should only be able to check off at most one of the checkboxes in each row. My first thought was to use radio buttons instead, but then I realized that with radio buttons you lose the ability to uncheck all options. Once you've selected a radio button in a group of radio buttons, there's no way for an end user to uncheck it again.

Fortunately, with a bit of jQuery, this is really simple to accomplish with checkboxes as I'll show you in this short article.

Read on ...
Image representing the Blogs category

How to Get a Free License of Red Gate's Reflector Version 7

Published 9 years ago

About three weeks ago, Red Gate announced that it will start charging $35 for Reflector version 7, when it comes out in early March. At the same time, they announced that the current free version will stop functioning shortly after that. Reflector has a "time bomb" built-in that requires you to periodically update your copy of Reflector to the latest version. They'll now use this time-bomb to kill the existing version, forcing you to upgrade to the latest - and paid for - version after May 30, 2011.

Read on ...
Image representing the Articles category

Using the Microsoft Access Providers for Membership, Roles and Profile under ASP.NET 4

Published 10 years ago

Back in August 2006 I wrote an article about replacing the built-in Application Services providers (such as the Membership and Roles providers) with a new provider targeting a Microsoft Access database, instead of a SQL Server database. This solution has worked well for many people who didn't have access to SQL Server on their production machine, or couldn't (or didn't want to) spend a lot of money for an extended hosting package that includes SQL Server.

I wrote the article using Visual Studio 2005 and the Microsoft .NET Framework 2.0 which was the bomb at that time. And while you can continue to use the concepts explained in the article in web sites that target ASP.NET 4 today without any modifications (you can easily consume .NET 2.0 DLLs in an ASP.NET 4 web site), you may run into some issues when you also want to compile the Access Providers assembly against .NET 4.

In this article I'll show you how to make the Access Providers work under an ASP.NET 4.0 web site.

Read on ...
Image representing the FAQs category

Troubleshooting Team Foundation Server and IIS

Published 10 years ago

Since about two weeks, I ran into all kinds of errors when working with Team Foundation Server 2010 using Visual Studio 2010. Whenever I tried to execute operations on a project level, such as updating to the latest version, getting a specific version, or checking in the entire project, I got all kinds of error messages. Checking in - or getting files - one by one seemed to work just fine.

Read on ...
Image representing the Blogs category

Tips for posting in the Wrox Forums

Published 10 years ago

I am an active contributor to the Wrox P2P forums, where I support readers of my books and other programmers that go there with programming related questions. I try to answer as many questions as I can but I only have a limited amount of time. This means I'll give preference to questions that are the easiest to answer. This is not related to the technical difficulty of the problem discussed, but to the quality of the question. Obviously, if you post a clear and concise question, you increase your chances of getting a useful and quick reply as it takes less time to understand the question and come up with an answer. Unfortunately, I see more and more people posting vague questions, and posting them in the wrong category. To avoid typing the same response over and over again asking for clarification, I decided to write a short blog post with a few tips for proper questions in these forums where I can refer to when unclear questions come up. If you get sent to this page, it's not that people don't want to help you; it's that they can't help you because the question is unclear or posted in an inappropriate location. Follow these tips and you'll improve the chances of getting the answer you're waiting for.

Read on ...
Image representing the Articles category

Building a Provider Based File Storage System Using .NET

Published 10 years ago

Many moons ago, in January 2007 to be exact, I wrote an article about storing files in the database using ASP.NET 2.0 and SQL Server. One of the features of the application I demonstrated in the article was the ability to switch between storing the actual file in the database, or saving it on disk. In both cases, meta data such as the content type and the original name were saved in the database, but by changing a configuration setting called DataStoreType you could determine if the actual file was saved on disk, or stored in an NText column in the database together with the meta data. In February of the same year, Steven Bey suggested to rewrite the application and base it on the provider model that has become a quite popular design pattern since it was introduced for the ASP.NET Application Services that appeared in ASP.NET 2.0. I added Steven's suggestion to my "Things to do when I have the time for them" list. And today is the day I finally found the time to do it. In this article I'll show you how I changed the application using the provider based model so you can switch between different providers, including various flavors of SQL Server and Microsoft Access. Adding support for other data stores then becomes really simple.

Read on ...
Image representing the Articles category

Programmatically Managing Application Services in ASP.NET

Published 10 years ago

Since version 2.0, ASP.NET ships with a set of the so called Application Services, including Membership, the Role Manager, Personalization, Profile and the SqlWebEventProvider. To enable these features, you have a few options. The most common way is to just start using one of the features, such as Login control on an ASPX page. The default setup is configured to automatically create a SQL Server database in the App_Data folder of a site with the services already enabled. Another very common way, to get more control over the setup is to use the aspnet_regsql tool. This GUI or command line tool gives you more control over the SQL Server and database you're targeting and the exact features you want to install. The downside of this tool is that you need to run it locally and need the permissions to execute it.

I recently discovered that you can also manage the application services programmatically.

Read on ...
Image representing the Blogs category

Want to Win a Copy of my Book Beginning ASP.NET 4 in C# and VB?

Published 10 years ago

I still have a number of copies of my latest book Beginning ASP.NET 4 in C# and VB waiting on my desk for someone to read them. Want to win a copy?

Read on ...

Mobile: False

Crawler: True

I: False