ASP.NET

Essential Developer SEO

There are many things that fall under the wide umbrella of SEO/SEM, and as a developer chances are high that you don’t really want to know about a large number of them. However like it or not if you’re creating web sites or applications there are some things you absolutely need to understand. All of what’s contained in this post is pretty simple stuff – but it’s absolutely essential. There are so many resources out there covering SEO, and yet I keep seeing sites which ignore some or all of the basic things I’m going to mention, and I...

Looking back on the past couple of years as a freelancer

It's coming up to the 2 year mark since I resigned from my full time job and went into freelancing / owning my own businesses. After many years of working as an employee, a contractor and doing small bits of freelancing on the side I probably thought that switching to freelancing would be a bit easier than it ended up being, which is part of why I wanted to write a little about my experiences. There's plenty of material out there offering freelancers helpful tips or things to avoid - this post is similar to many of those, but it's...

The obligatory Happy New Year post

This is the obligatory Happy New Year post.. so, happy new year all! I’ve got quite a few posts currently sitting in various stages of draft – I’d planned to write a bit around Christmas, however the novelty of actually having a break took over. So I’m a little behind, but feeling well rested. Here’s a quick preview of what I’ve currently got sitting in draft: My “lessons learned” post from experience over the past couple of years as a freelancer/small business owner. Writing down a bit about my experiences was helpful for my...

Using the asp:Chart control

The world of .NET is an exciting and ever changing environment to work in so it’s easy to occasionally miss useful things when they’re released. The asp:Chart control fits into this category – it was released well over a year ago, however I haven’t had any reason to use it until very recently. Here's a short (possibly the shortest) post with a snippets of information that I found useful about the Control, my 60 second summary if you will. To use the control with version 3.5SP1 of the .NET framework you have to install a...

jQuery and Microsoft

A while ago I did a bit of exploring into jQuery. I really liked what I saw, and was trying to decide whether to invest a bit of time into knowing it better - but with so many JavaScript frameworks and libraries out there it's hard to know which ones are worthy of attention. It looks like Microsoft and jQuery have made that decision a lot easier, with this announcement from Scott Guthrie: I'm excited today to announce that Microsoft will be shipping jQuery with Visual Studio going forward.  We will distribute the jQuery JavaScript library as-is, and will not be...

More ASP.NET MVC goodness

There's more MVC goodness announced on ScottGu's blog, namely the Preview 4 release which means another step closer to the final thing. As always there's a bunch of useful info showing it all in action, so check it out. Tags: ASP.NET , MVC

ASP.NET AJAX Roadmap

If you work with ASP.NET and AJAX then you'll probably want to take a look at Microsoft's ASP.NET AJAX Roadmap document. After restating their goal of "making ASP.NET Ajax the first-class choice for all Web 2.0 Developers" they start listing some of their ideas for the future. Template driven binding sounds useful, and I've recently come across a few people mentioning that even though the version in Atlas had it's faults, that it was still a good idea. The DOM APIs around element selection look useful,  and there are various other shiny things such as increased animation effects...

SQL Server Web Report Viewer Issues on Windows 2008 Server/IIS7

About a year back I wrote a quick post detailing a problem (and a fix) for an issue I was having with the SQL Server Web Report Viewer on Windows 2008 Server/IIS7 (the 'RSClientController is undefined' error). Most of the comments implied that the article helped people, however a few people weren't able to follow what was written. Partly because I wrote it very quickly at the time it was happening, and didn't grab a screenshot at the time. So I've just gone back and made a quick update to the article so that it now includes a bit...

LINQPad

  LINQPad is a handy tool for anyone who works with LINQ: LINQPad is more than just a LINQ query tool: it's a code snippet IDE. Instantly execute any C# 3 or VB 9 expression or statement block! Best of all, LINQPad is free and needs no installation: just download and run.  The executable is under 2MB and is self-updating. Fun! Tags: ASP.NET , SQL , LINQ

The Dramatic Password Reveal

I found "The Dramatic Password Reveal" to be an interesting read. It's interesting to read the post and gauge your own personal reaction, followed by whether you change your mind after stopping and thinking about it a little bit. As the owner of 2 Das Keyboards I can tell you that there are many times when revealing my password for a quick double check before entering would be useful. Occasionally for online accounts I'll find myself typing my password into Notepad and then pasting it into the form to prevent me from locking my own account out. ...

VS 2008 Web Development Hot-Fix Roll-Up Available

Scott Guthrie posted on Friday about the release of the long awaited hotfix. Although there are a lot of issues addressed with this release, the ones I was most interested in were those around HTML Source view performance - after a quick test this morning it seems fixed. (Thanks Sonic, that's a nice way to start my Monday!) Link: Scott Guthrie: VS 2008 Web Development Hot-Fix Roll-Up Available Tags: Visual Studio , Microsoft

ASP.NET and HTML Injection Protection

5 signs your ASP.NET application may be vulnerable to HTML injection is worth a quick read, and How Dangerous is HTML injection makes a good companion piece. There's something amusing sounding about the phrase "Injection Protection".

Visual SourceSafe 2005 Update

For those wanting to run Visual SourceSafe 2005 with Visual Studio 2008 (hang on, does anyone actually *want* to run Visual SourceSafe?), grab the recently released update (December 13th 2007) which is a rollup pack containing bugfixes as well as improved compatibility with VS2008. Tags: Microsoft , SourceSafe , Visual Studio

ASP.NET 3.5 Extensions CTP Preview Released

Get your early dose of MVC goodness for Visual Studio 2008 here (and here for the MVC Toolkit extras). There's interesting mention of a few other items included in the extensions preview. One thing I've not followed closely is ADO.NET Data Services. The ADO.NET Entity Framework is billed as "a modeling framework that enables developers to define a conceptual model of a database schema that closely aligns to a real world view of the information". I'm very interested to see how this competes with something like LLBLGenPro (or even if that's it's intention in life). Tags: ASP.NET...

Parallel Extensions CTP

The December CTP of Microsoft's Parallel extensions has recently been released. Some info from the download page: Parallel Extensions to the .NET Framework is a managed programming model for data parallelism, task parallelism, and coordination on parallel hardware unified by a common work scheduler. Parallel Extensions makes it easier for developers to write programs that scale to take advantage of parallel hardware by providing improved performance as the numbers of cores and processors increase without having to deal with many of the complexities of today’s concurrent programming models. Basically a set of extensions...

You down with MVC? Yeah you know me!

Ok, it's a pretty crappy pun, but someone had to use it. A couple of MVC/MVP related links: MVC demo sourcecode MVC or MVP Pattern – Whats the difference?

An interesting take on the ASP.NET MVC framework

Mads Kristensen has an interesting take on the potential dangers in Microsoft's ASP.NET MVC Framework. Some people might think he's being overly cynical, but there's definitely some valid points in there. Attend any event which contains a mix of C# and VB developers, and start talking about language and you'll see the same sort of effect. I love the term "Search Driven Development" that he uses in the post. It's a pretty obvious one, but I've never heard it put like that before. Technorati Tags: ASP.NET , MVC

LLBLGenProDataSource2 v2.5 and hosted environments

A while back I mentioned that I was playing about with LLBLGenPro's ObjectDataSource in conjunction with ASP.NET GridViews in order to deliver a simple user interface allowing basic CRUD type operations in little or no development time. I hit a slight snag the other week when I upgraded to release 2.5 of LLBLGenPro. Everything was looking fine until I deployed the solution up to my hosting provider - at which point every page containing a LLBLGenProDataSource2 control started throwing security exceptions. It's always fun debugging issues with a hosted environment. The provider's setup is always something of a black box,...

SQL Command Visualizer for Visual Studio 2005

SQL Command Visualizer for Visual Studio 2005 will give you a visual representation of a SQL Command object, allowing you to work with the connection details, parameters, properties, and values. I can't remember the last time I actually worked with ADO.NET at this level, but still this could be very useful for anyone who still needs to work with SQL Commands.   Tags: Visual Studio, ADO.NET

More real world LLBLGenPro code

I love working with LLBLGenPro. However sometimes I go through a process of adapting what I want to do into LLBL speak. I'm still pretty new to using the tool, so I figured I'd throw up some of the more useful chunks of code relating to real world problems just in case someone else finds them useful. The Problem You have a list of entities, lets call them "Categories". You're dynamically creating a total related to these categories, lets say "the number of images in each category". Finally, you want to filter your result set (using LLBLGenPro -...

LLBLGenProDataSource2, GridViews, and Case Sensitivity

I've been playing about with LLBLGenPro's Object Data Source recently. Mostly because I want to know if it's the sort of thing which could actually be used in a commercial project, or whether it's not quite all the way there yet. In my experience, working with GridView style pages goes one of two ways: They're simple, basic CRUD type operations. Maybe some sorting and/or paging. They're so insanely custom that you might as well have written your own control and not even used a GridView/Repeater. I'm looking at LLBL's Data Source for the occasions which fall into option #1....

Thursday Linkorama

I've had a load of tabs open in my browser for the last week, all of which are useful and interesting, but none of which justify a full post. Here they are: Scott Guthrie talking about the asp:Listiew Control which is coming in ASP.NET 3.5 - I've been working with GridViews and Repeaters over the past couple of weeks, and doing so is making me really look forward to the ListView! As welcome as the control will be, you have to think that it's been a loooong time in coming (thanks for the link Doug, even if I did forget...

Fun with Forms

"Fun"! This weekend I was working on some basic ASP.NET input forms inside an existing application. The forms can be opened for read mode, or for edit mode - as you might expect from a form! There was some C# code which was setting the textboxes to be enabled or disabled (but still visible) depending on the appropriate edit mode, and I naievely figured it'd be pretty easy to throw in some css to simply remove the textbox borders when the form was being viewed, which would make the data look like labels. Labels being what should have been used in this...

Developing Linq for LLBLGenPro

Fans Bouma is documenting the process of adding linq support to LLBLGenPro in a series of posts. One of the pingbacks named the series "A diary of LINQ pain" which sounds pretty appropriate! Tags: LLBLGenPro, Linq

Web Site Projects

I've never liked Web Site projects. It's not that I've ever really had a reason to despise them, I've just always chosen Web Application Projects if given a chance - even in the pre SP1 days when they came as an additional install. Now, after being forced to use them for a few months (in one of those "not my architecture" situations) I've come to be able to put names and faces to all the reasons I'd subconsciously discriminated against them in the past. Firstly, the time delays in building - by default, with large projects the build...

Testing Web Applications on IE6

I've talked previously about options for performing IE6 Web Application testing. Some of them are pretty half arsed, and really the best approach is to keep a Virtual Machine handy. It's a funny situation when you need to quickly verify an IE6 issue, only to find that you don't have a copy of IE6 on ANY machine ANYWHERE - even servers! Fortunately Microsoft has a solution, even if it's a temporary one. This Virtual PC Image is a pre activated copy of Windows XP that comes with IE6 - you're a mere 600mb download away from being able to perform...

Now running Subtext!

The observant among you will notice that the site has changed. I'm no longer running on Domino, and hence I'm no longer running on Blogo. The site is now fully powered by ASP.NET, and is running the excellent Open Source Subtext. Thanks go out to Ferdy for all the time he's spent writing and maintaining Blogo - if you're in the market for an open source Domino blogging engine then check it out, it's well worth it. Why Subtext? I can't really say. I played with a few .NET solutions out there, and decided that I really liked quite a few...

A couple of quick fixes to the AjaxControlToolkit CalendarExtender

The AjaxControlToolkit CalendarExtender is one of the more usable and useful controls in the kit. However there are a couple of things you might want to do to it in order to increase it's usefulness: First, the default behavior is to hide the calendar when the textbox you're extending loses focus. This might be ok for some people, but I wanted it to disappear when a date was selected. Simply add a hideCalendar function, which you can either do in static JavaScript or via RegisterClientScript block depending on your application: Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "hideCalendar", @"function hideCalendar(cb) { cb.hide();...

ReSharper 2.5.3

ReSharper 2.5.3 is now out, and represents the last 2.5.x release for those of you who aren't planning/able to go to 3.0. There are a fair few fixes, specifically in the area of ASP.NET support. Grab it if you're not planning to move to 3.0. (3.0 has been fine on my XP machine at home, but I still need to find time to re-test it on my work Vista box, where I was experiencing weird behaviour) Tags: ReSharper,

Subtle Lock in - liberating my data from Notes Databases Part 2!

The final part of my data migration involved migrating the site's comments, and placing them against the correct entries in the newly populated SQL Subtext database. I used the same techniques as previously to get the bulk of the SQL script created, with one minor addition. Can you spot it? utcDateTime := @Text(@Year(@Created)) + "-" + @Right("0" + @Text(@Month(@Created)); 2) + "-" + @Right("0" + @Text(@Day(@Created)); 2) + " " + @Right("0" + @Text(@Hour(@Created)); 2) + ":" + @Right("0" + @Text(@Minute(@Created)); 2) + ":00.000"; NewEntryID := "set @newentryid = (select top 1 ID from...

The Most Useful .NET Utility Classes Developers Tend To Reinvent Rather Than Reuse

Wow, what a post title. It's a couple of weeks old, but this list over at haacked.com is a quick list of classes that developers tend to code themselves rather than use what's provided in the framework. The constant reinvention is symptomatic of a large and comprehensive framework - there's so much in there, it's sometimes hard to know where to look for something that does what you're trying to do. Looking through the list was quite refreshing. There were a few obvious ones such as System.IO.Path.Combine, however I'd never thought that a framework which is destined to...

JavaScript intellisense in Visual Studio 2008

Scott Guthrie talks about Visual Studio 2008 and it's support for JavaScript intellisense. It looks pretty slick, however I'm guessing that the computation and evaluation required to provide type inference is going to be pretty CPU intensive. Ah well - Moore's law states that we'll all have had a few computer upgrades well before 2008 right? I'm hoping that the support for intellisense within external JavaScript files means that 2008 will offer additional navigational tools - 'go to declaration' being quite a welcome addition. Navigating through large chunks of JavaScript split across multiple files can be a bit...

New AJAX Control Toolkit release

The latest release of the AJAX Control Toolkit is now available. On top of over 125 bug fixes and enhancments the new Toolkit includes something called the "ToolkitScriptCombiner" - a control designed to dynamically merge multiple client-side Javascript scripts into a single file that is downloaded to the client at runtime. 2007-06-06 release of the AJAX Control Toolkit has a number of fixes identified as important by the community including designer support for Tabs and Web Services. It also has Animation support for some extenders, event support across the Toolkit, a Script combiner for reducing...

Styling the Atlas UpdatePanel and UpdateProgress controls

Out of the box, the ASP.NET Ajax UpdatePanel and UpdateProgress controls do a pretty good job of removing postbacks from your applications, but they need a little bit of styling to get them looking their best. Here's a couple of links to get you started on the right track: Link: Using the UpdateProgress as a modal overlay Link: Gmail style 'loading' indicator using UpdateProgress Link: UpdateControls: UpdateHistory and AnimatedUpdatePanel Raj's modal overlay (the first link above) allows you to target either an individual control (such as a panel or a GridView), or the entire page. It's very slick looking, but...

ReSharper 3.0 Beta now available

The beta release of ReSharper 3.0 is now available for downloaded. The product now features support for VB.NET (Revisualbasicer?), XAML, as well as additional productivity enhancements. ReSharper 3.0 Beta expands its versatile support of languages and technologies, providing improved functionality for C#, VB.NET, ASP.NET, XML, XAML, build script editing and integrated unit testing. In other improvements, ReSharper 3.0 brings much-awaited XML and XAML support. XML features include type completion, various navigation between tags, navigation to referenced types, basic code assistance, and live templates support. XAML features include XML editing in XAML code, all three types of ReSharper's...

A quick tip for working with UpdatePanels

UpdatePanels are a pretty neat part of Microsoft's Ajax Extensions. It's interesting to note how much faster pages *seem* when you remove all visual aspects of the postback. Sure, the postback is still happening, but without the need to re-render the entire page things seem so much snappier. However to make sure that your page is running as fast as it possibly can, remember to set the UpdatePanel's UpdateMode to Conditional (which isn't the default). It might seem like an obvious thing, but when you're working on complex pages that contain multiple UpdatePanels, multiple UpdateProgress controls, as...

C# and the Compilation Tax

I write this post at the risk of sounding like a complete and utter ReSharper fanboy. However I had a great moment while reading C# and the Compilation Tax when I went "Huh?" at a couple of paragraphs: What's particularly sad about this is that, in my experience, most C# developers think manually compiling all the time is a natural state of affairs. Well, it isn't. In VB.NET we have this clever little technology we call background compilation. Background compilation saves you the effort of all that meaningless, repetitive, mind-numbing manual compilation. It's very simple: as...

ReSharper Keyboard Shortcut of the month

CTRL-SHIFT-V. The funny thing about this shortcut, is that it's so close to CTRL-SHIFT-B that I can't believe I haven't hit it accidentally before now while building a solution. Today however, after having used ReSharper for over a year, I did hit it by accident and found out that it's basically ReSharper's version of a clipboard paste which allows you to paste any of the last 20 text items that were copied to the clipboard (from any application) into your current window. ReSharper also provides you with a simple preview window to make sure you're pasting exactly the...

Microsoft AJAX Extensions: Sys.Debug is null or not an object

One of the breaking changes which was made with the 1.0 release of the Microsoft Ajax Extensions was the renaming of the 'Debug' class to 'Sys.Debug' for reasons of compatiability with other frameworks. Breaking changes like this can often be a source of frustration, however today I was pretty glad that they renamed the class, as it helped me to troubleshoot issues with the awful MSI on a Vista development box. The problem shows as a JavaScript error which states "Sys.Debug.IsDebug is null or not an object", basically telling you that something is using the wrong version of...

Problems Installing/uninstalling Guidance Automation Extensions and Toolkit

Installation issues surrounding the Guidance Automation Extensions and Toolkit seem pretty common, including the infamous error 2869. There are a lot of postings where people had their issues solved by simply running the installers with elevated Administrator prilleledge, either via a command prompt or .cmd file. I recently had some issues installing the Web Service Software Factory on a Vista box, and no amount of Administrator elevation would shift it. The Web Service Software factory claimed it needed GAX to be installed, however GAX was already there. The GAX uninstaller wouldn't run, giving error 2869. I tried using...

IIS7 beta3 now available

The IIS 7.0 Beta3 shipped a few days ago with a Go-Live License for those of you who simply can't wait to get your production apps installed on the latest and greatest version of Microsoft's web server. Alternatively, there are plenty of webhosting providers who have installed the beta and are now offering it to customers so you can perform some testing without needing to perform any upgrades. This is especially handy if you're still using Windows XP or 2003 server, and don't have any spare hardware available to install Longhorn or Vista (which IIS7 requires). On a...

ReSharper 2.52 released

ReSharper 2.52 has been released. Although it's only a minor build, there's a nice long list of fixes as well as a change in their evaluation license model: Another maintenance release of ReSharper is here. The release includes a number of bug fixes and a new evaluation model which needs some explanation (but don’t worry, it will only make things easier for you as an evaluator!). Link: ReSharper 2.5.2 Released Link: Download ReSharper 2.52 Link: ReSharper 2.52 Release Notes Tags: ReSharper

RegEx Performance Options

It's obviously not new, but the January 2006 edition of MSDN Magazine has some useful performance tips, particularly in the area of Regular Expressions. File this under the category of 'things I talk about here so I can refer to them myself later'. A few quick quote snippets: In the Regular Expression (Regex) space, there is the option to specify that a regular expression is compiled through use of the RegexOptions.Compiled setting. This switch hints at an underlying aspect of regular expressions in .NET: they have three modes. Interpreted Regexes have the...

Debugging DataSet Constraint issues

If you work with typed datasets often enough, then chances are that at some point you're going to run across this error message: Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints. The error message is logical enough - it tells you what's wrong. You have a dataset, and there's a piece of data which is violating it's constraints. If you have a small dataset, then you can usually spot where the problem lies quickly enough. However for larger datasets the offending table(s) and/or column(s) are usually harder...

WebResource.axd followup

Back in October 2006 I wrote an article which covers troubleshooting problems related to WebResource.axd. A few months down the track, and the article has had a lot of hits, a few comments, and a few external links - I can only conclude that a lot of you out there have had major problems with WebResource.axd! I wrote the article as a result of problems when deploying the project I was working on at the time, and it seems that I was 'lucky' enough to need to make changes or to verify the configuration for a lot...

Fun with MSMQ

Working with MSMQ is pretty simple. A couple of quick google searches will return a nice array of code snippets and tutorials to help you get started. If you prefer books, there are heaps of them out there too, although I'm not really sure how you write entire book which is based soley on MSMQ, but I assure you they do exist. I understand that if you're developing an enterprise application that you'd probably want to use some more complex features of MSMQ, but the basic concept isn't that hard - put a message on the queue, take a...

SQL Server 2005 SP2 now available

SQL Server 2005 SP2 is now available for all versions. Link: Microsoft SQL Server 2005 Service Pack 2 Link: What's New in SQL Server 2005 SP2 Tags: Microsoft, SQL

Small DataSet tip - blank/empty .cs files

If you happen to press F7 in the while working in the DataSet designer, it will generate you a class file for your DataSet. If you've pressed F7 accidentally and dont want/need this file, then you might delete it at some point, or someone tidying up your code might decide to do it for you. The file might seem like an obvious candidate for deletion - the main hint being that it contains no code! However, if the file is simply deleted then your solution may no longer compile. The solution is pretty simple - you simply need...

Visual Studio 2005 Service Pack 1 (SP1) Released

This one managed to slip by me. I'm not sure on the exact release date, but looking at digg.com makes it look like it was released only a couple of days ago. There are seperate downloads for Visual Studio 2005 Team Suite (includes SP1 updates for Standard, Professional, and Team Editions of Visual Studio 2005), Visual Studio 2005 Team Foundation Server, and Visual Studio 2005 Express Editions. The version for Windows Vista (beta) is apparently coming soon. There are a lot of important fixes in this service pack, especially for anyone working with Team Suite to do load...

ASP.NET Text Character Counter

A textbox character counter is a pretty simple piece of functionality, and there's a lot of different ways to apply one to your application. The following method is nice and simple, and can be done using only clientside JavaScript if required, or combined with server side code in order to create a more dynamic effect (ie, turning the counter on/off conditionally). First, we'll add the most basic static implementation of the field counter to a form using only a JavaScript function and event handlers in the aspx file, then we'll look at how we can extend the functionality...