Posted by: Peter Lanoie at Saturday, August 06, 2005 8:24:37 PM in:
ASP.NET 1.x
You may have the need to be able to get the URL to a page in a web application from the server code. This might be because the page could move or because the URL is dynamic in some way. While this would be a nice feature to have in .NET, there are reasons it is not. We'll discuss this and a simple solution for getting a page's URL in server-side code that saves us from hard coding it in the referencing pages.
Read on ...
Posted by: Imar Spaanjaars at Saturday, May 14, 2005 3:31:51 PM in:
ASP.NET 2.0
Today I was experiencing unexpected 404 "The resource cannot be found" errors when working with Visual Web Developer 2005 Express Edition beta 2 in combination with the ASP.NET Development Server. No matter what I tried, and what file I tried to open, I kept getting the same error.
Read on ...
Posted by: Imar Spaanjaars at Sunday, April 17, 2005 6:39:28 PM in:
ASP.NET 2.0
The new ASP.NET 2 data controls, like the SqlDataSource and the AccessDataSource grealty simplify data access in your Web Applications. However, they have one major drawback: they flood your pages with Sql statements. Not so with the ObjectDataSource, that enables you to bind to the results of a standard method in your Business Logic Layer. The ObjectDataSource can in turn be bound to a data aware control, like the new GridView or DetailsView controls
Read on ...
Posted by: Imar Spaanjaars at Monday, March 07, 2005 10:12:30 PM in:
Imar's Blogs
I recently downloaded and installed the
Microsoft Enterprise Library and I must say it's an amazing piece of technology. I've been using several of the separate Application Blocks in the past and they have saved me a lot of development time.
Read on ...
Posted by: Peter Lanoie at Thursday, March 03, 2005 10:55:01 PM in:
.NET General
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 ...
Posted by: Imar Spaanjaars at Saturday, February 26, 2005 4:48:08 PM in:
VS.NET 2003
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 ...
Posted by: Imar Spaanjaars at Saturday, February 26, 2005 3:20:31 PM in:
ASP.NET 1.x
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 ...
Posted by: Imar Spaanjaars at Sunday, February 13, 2005 9:34:30 PM in:
Imar's Blogs
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 ...
Posted by: Imar Spaanjaars at Sunday, February 13, 2005 12:35:08 PM in:
CSS
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 ...
Posted by: Imar Spaanjaars at Saturday, February 12, 2005 9:09:07 PM in:
ASP.NET 1.x
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 ...