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 Snippets category

Overriding Individual Application Settings

Published 19 years ago

You may have the situation where you want to be able to override application settings for a .NET application only for your particular instance of the application. This is often the case when you are developing the application, you need to change only the local settings, but you don't want to change the config file that is part of the project and under source control. Here we'll explain the solution that .NET provides but isn't so well known.

Read on ...
Image representing the FAQs category

How Do I Allow my Visual Studio .NET Projects to Run from a Network Location?

Published 19 years ago

When you try to create a new project in Visual Studio .NET 2003 on a network drive, you might get the following error:

The project location is not fully trusted by the .NET runtime. This is usually because it is either a network share or mapped to a network share not on the local machine. If the output path is under the project location, your code will not execute as fully trusted and you may receive unexpected security exceptions. Click OK to ignore and continue. Click CANCEL to choose a different project location.

You get this error because by default .NET framework does not fully trust network locations. It's easy, however, to grant this trust to your projects, or your entire Visual Studio Projects folder.

Read on ...
Image representing the Snippets category

How Do I Pass Credentials to a Web Service that Uses Basic Authentication?

Published 19 years ago

When you're working with Web Services that require authentication, you'll need a way to pass credentials. This snippet shows you how to pass a user name and password to a Web Service that is configured for Basic Authentication.

Read on ...
Image representing the Blogs category

New Features and Articles Added

Published 19 years ago

This weekend I finally got some time to work on my site again. I added two short FAQs in the ASP.NET section and a snippet in the CSS section. I also added a few new features and fixed some bugs

Read on ...
Image representing the Snippets category

A Scrollable Table With a Fixed Header

Published 19 years ago

Consider this solution as obsolete as there are better alternatives available. Search the comments to this article for a few external links to better implementations.

If you need to present a lot of table based data, but you don't want to spoil your page layout with a very long table, you can use the following trick to create a scrollable table with a fixed header.

Read on ...
Image representing the FAQs category

How Do I Determine if a Control Bound to a DataReader Has Rows?

Published 19 years ago

If you use .NET Data Binding to bind data from a data source (like a DataSet) to a control (like a DataGrid or Repeater) you often want to know if the control contains any rows. You can then use this knowledge to, for example, hide the entire DataGrid and display a message with the text "No records found" instead. You can easily accomplish this with a DataSet, because you can retrieve the number of items in the DataSet using something like myDataSet.Tables[0].Rows.Count. But what if you use a DataReader like the SqlDataReader? This class does not expose a count property.... Fortunately, there is a way to work around this.

Read on ...
Image representing the FAQs category

How Do I Add a Client Side Message Box to ASPX Pages?

Published 19 years ago

Update: 06/11/2006
Due to a number of requests I received, I have added a VB version of the code example in this article

In many applications, it's common practice to use a client side dialog, like a message box, to ask the user for confirmation or display a message. For example, if you allow a user to delete, say, an article on your site, you better ask if they are sure they want to delete the item. Many people know they can add a confirmation box to standard HTML or classic ASP pages. However, the same trick is less well known for ASPX pages, but just as possible and easy to implement. This FAQ will show you a few different scenario's for adding a confirmation dialog to your ASPX pages.

Read on ...
Image representing the Articles category

Migrating to ASP.NET 2 - Part 2 - Setup and Master Pages

Published 19 years ago

This is the second part of a (long running) article series about migrating a .NET 1.x Web site to ASP.NET 2. This installment focuses on the general setup of the new web site and the Master Page I am going to use.

Read on ...
Image representing the Articles category

'Re'implementing Interface Implementations: VB.NET vs. C#

Published 19 years ago

Let's say we have an interface implemented on a class. We want to create a subclass derived from the super class and change the implementation . The difference between C# and VB.Net make this a little tricky. So let's take a look at how it's done.

Read on ...
Image representing the FAQs category

How Do I Make ADO Constants Available in my ASP Code?

Published 19 years ago

If you use any ADO constant, like adOpenForwardOnly etc, ASP has to know what adOpenForwardOnly really means. There are a couple of ways to tell ASP where to look for these constants.

Read on ...

Mobile: False

Crawler: True

I: False