Quantcast
Channel: .NET Addict
Browsing latest articles
Browse All 22 View Live

Image may be NSFW.
Clik here to view.

Visual Studio 2008 var Keyword ‘Bug’

I stumbled across an interesting bug while editing an ASP.NET web project in Visual Studio 2008 a few days ago and I figure after four years of using the Visual Studio suite without encountering any...

View Article



Image may be NSFW.
Clik here to view.

Visual Studio 2008 var Keyword ‘Bug’ – Microsoft Follow-up

I got a response back from Microsoft support regarding an issue with the var keyword in Visual Studio 2008 and what they had to say isn’t particularly surprising (or motivating):Thanks for the...

View Article

Image may be NSFW.
Clik here to view.

ASP.NET Validation - Client-Side IsControlValid() Function

View DemoDownload Source Code While working on a rather unique form for one of the websites I maintain at work (Rated Golf) I found myself needing to do some very case specific form validation on a...

View Article

Image may be NSFW.
Clik here to view.

Check for Content in Control

While working on a project recently I had a requirement for ContentPlaceHolder in my Master Page that was wrapped in a container that I only wanted to render if the ContentPlaceHolder was actually...

View Article

Image may be NSFW.
Clik here to view.

.NET Reflection - Generic Method Type Inference of a Boxed Parameter

Before I begin- this is a fairly lengthy post and if you'd rather not read the whole thing and would just like to know how to pass a boxed object to a generic method and have the run-time properly...

View Article


Image may be NSFW.
Clik here to view.

ASP.NET Web.config - Simple Website Settings Provider

While working on a new website today I felt compelled to make myself a simple, type-safe accessor for fields in my Web.config. Using some handy reflection I came up with the solution below. Upon a call...

View Article

Image may be NSFW.
Clik here to view.

Shell Command - Delete Visual SourceSafe Files

Visual SourceSafe has a tendency to litter version-controlled directories with 3 types of project tracking files (*.scc, *.vssscc, *.vspscc) that may be undesirable when sharing a project with others....

View Article

Image may be NSFW.
Clik here to view.

Multiple Web.config Management Utility

Something we all face on a regular basis is managing our Web.config files across multiple deployment environments each with their own specific set of options. The trivial, but repetitive task of...

View Article


Image may be NSFW.
Clik here to view.

ASP.NET MVC2 RC2 - Breaking Area Registration Change

With the release of ASP.NET MVC RC2 there is a breaking change in the way area registration works. As of RC2, all AreaRegistration types must be marked public, or they will be ignored by calls to...

View Article


Image may be NSFW.
Clik here to view.

System.ComponentModel.DataAnnotations Validation Attributes – Using Error...

Just a quick-tip if you’ve been making use of the wonderful set of model validation attributes available in System.ComponentModel.DataAnnotations. If you elect to use the ValidationAttribute’s...

View Article

Image may be NSFW.
Clik here to view.

How to Make a Tag Cloud in ASP.NET MVC

As many of you are aware, tagging offers users a quick and easy way to filter website content by interesting topics or categories and a tag cloud acts as a visually asethetic way to display links to...

View Article

Image may be NSFW.
Clik here to view.

C# Truncate String

To preserve whole words when truncating, try this version: C# Truncate String - Whole Words A simple extension method to safely truncate any string to a predetermined length:public static string...

View Article

Image may be NSFW.
Clik here to view.

ASP.NET MVC Flags Enumeration Model Binder

The default model binder that ships with ASP.NET MVC 2 handles the large majority of databinding scenarios; however, one feature it does not support is combining a set of flags enumeration values into...

View Article


Image may be NSFW.
Clik here to view.

ASP.NET - Redirect Module

As developers we are all intimately aware of the implications of changing the URL of existing content in our applications which have already been indexed by search engines and users. It is never enough...

View Article

Image may be NSFW.
Clik here to view.

ASP.NET – Convert Relative URL to Absolute

See my follow up post for an alternative ToAbsoluteUrl() which accepts file-system-relative paths instead of app-relative paths: ASP.NET – Convert Relative URL to Absolute (Part 2).Having built a...

View Article


Image may be NSFW.
Clik here to view.

ASP.NET - Convert Relative URL to Absolute (Part 2)

This is a follow up to my previous post: ASP.NET - Convert Relative URL to Absolute.Twitter user @GeertDoornbos alerted me to a more concise way to convert a relative URL to an absolute which offers...

View Article

Image may be NSFW.
Clik here to view.

How to Get the Fully Qualified Name of a .NET Assembly

In .NET, when referencing satellite assemblies it is generally best practice to use an assembly’s fully qualified name, which includes the name, version number, culture and public key token. The...

View Article


Image may be NSFW.
Clik here to view.

ASP.NET MVC Comma Separated Values Model Binder

In some scenarios such as data filtering it becomes necessary to pass multiple values to a single collection-typed request parameter. In typical flows this is achieved by passing multiple pairs of key...

View Article

Image may be NSFW.
Clik here to view.

C# Truncate String - Whole Words

This is an update to my original string truncate helper which can be set to respect whitespace when terminating a string. This version will start at the character index specified as max length and then...

View Article

Image may be NSFW.
Clik here to view.

Identifying browsers with JavaScript disabled

In this day and age, a user without JavaScript enabled is going to have an awful time on the web and, quite frankly, “graceful degradation” and similar no-JavaScript fallbacks are a waste of time. That...

View Article

Image may be NSFW.
Clik here to view.

ASP.NET MVC – Get field Name and Id for Model properties

ASP.NET MVC provides a number of convenient HtmlHelpers for form elements which accept a Lamda Expression returning a Model property as their first argument. The key advantages of these HtmlHelpers is...

View Article


Image may be NSFW.
Clik here to view.

Target Multiple Platforms and Framework Versions with Visual Studio Shared...

Visual Studio 2015 included a useful new feature known as a Shared Project. Apparently borrowed from Xamarin Studio, the Shared Project is a unique project type in that does not represent any...

View Article

Browsing latest articles
Browse All 22 View Live




Latest Images