Archives
-
Resizing images from the server using WPF/WIC instead of GDI+
Bertrand Le Roy has this on his blog today: http://weblogs.asp.net/bleroy/archive/2009/12/10/resizing-images-from-the-server-using-wpf-wic-instead-of-gdi.aspx
-
The jTemplates plugin for jQuery – Keep inline templates from being misinterpreted
I love the jTemplates plugin for jQuery. It works great and I’ve had very little trouble working with it when I put my templates in separate files. This ensures that the browser does re-interpret the html for the template and re-arrange the elements. This happens mostly with tables in IE and Webkit browsers where you want to repeat the rows of the table. You’ll see what I mean in a moment.
-
Configuration, System.Diagnostics and Medium Trust
In the past, I have widely used, and been a fan of, TextWriterTraceListener and EventLogTraceListener configured via the web.config in order to output diagnostics information from a web app or site. These things have been there since .Net 1, so our main library of code has hooks into System.Diagnostics. We even implemented a messaging aspect to this so that certain critical errors would trigger an SMTP message to us. This has been invaluable in determining what is happening with a site as content changes, or something happens that we need to take action on before a complaint comes in. (Who am I kidding – this is how we find out about bugs that got missed for whatever reason).
-
Shrinking your SQL Server 2005 Transaction Log
I get this question all of the time, and there is a great support article from Microsoft on how to do this.
-
CNET News: Visual Studio 2010 to launch in March
According to this article from CNET News from October 19th, Visual Studio 2010 will launch in March, 2010. This sort of follows the current timeline, where the Beta 2 has just been released, and we can probably expect another beta and/or a Release Candidate drop to evaluate before the final release.
-
Closer to the finish line with VS 2010 and .Net 4.0!
Today on his blog, Scott Guthrie announced on the availability of beta 2 for VS 2010 and .Net 4.0.
-
More URL Routing in Asp.Net 4.0…
We do our own routing with Agility CMS, however we are looking at switching to the more standardized routing built into Asp.Net (as of 3.5sp1).
-
TFS Power Tools – Get Changeset, Rollback Changeset
Check it out - http://blogs.msdn.com/buckh/archive/2005/11/16/493401.aspx
-
Getting excited about AJAX again (but will I use jQuery or Microsoft Ajax 4.0 – or both?)
Dave Reed has a great example of how to do few different things in Preview 5 of Microsoft Ajax 4.0.
-
Always check for null on Request.UserAgent…
Personally, I love the “Browser Capabilities” project on codeplex (http://browserdetection.codeplex.com/) that does a nice job of extracting the actual things that a browser can do, saving you from doing things the following:
-
A new blog I’ve started reading (and should have read earlier…)
I’ve started read Dave Reed’s blog “Infinities Loop”. He’s a member of the ASP.NET team and has some great insight on what’s happening now and in the future of ASP.NET.
-
How JSONP works
There are a plethora of explanations for JSONP (JSON with Padding, I think it stands for) out there – just search for “how JSONP works” and you’ll get a ton of descriptions. JSONP is provided as an alternative to normal JSON by jQuery on the client side to enable the invocation of services outside of the current domain.
-
TFS: Who edited this text? – Annotations in source control…
If you were ever looking at some code and wondered who actually changed the line of text you were currently looking at, there is a way to do just that!
-
Run threads and async handlers under the same impersonated identity as the website
When you run a background thread or async handler in asp.net, the thread will not run with the same identity specified in the impersonate tag of the web.config. You can easily get around this by grabbing the identity before the thread starts and either storing it in a variable or passing it to the thread as part of the ParameterizedThreadStart delegate.
-
ResolveUrl in Javascript
This is something that is super easy, yet I get asked about it quite often.
-
CSS: Get rid of dashed border on focused elements
Disclaimer: This is meant to be use ONLY ff you do NOT want your user to be able to Tab through the links on your site, or if you have already coded the :focus subclasses or onfocus script events for all of the elements in your site that you wish your user to be able to visually tab through.
-
Visual Studio Team System 2008 Database Edition GDR R2
This is the update to the VS 2008 Database Edition and adds support for SQL Server 2008 and no longer requires a local database server to operate. It was released back in April, but I just realized I needed it when I installed SQL Server 2008 on my local development machine, and found out that the base install does NOT support SQL Server 2008.
-
Minify your Javascripts!
This is a process that is becoming more and more important as we offload a ton of our page processing to .js files as opposed to HTML files processed by the server. This is because we are doing more client templating and logical processing on the client and not on the server.
-
Amazon Web Services Import/Export – fill your S3 buckets without killing your bandwidth
-
Remember to check-in when you re-format your machine!!!
Besides losing any code you may have written that you’ll never get back, those pending changes or locks will be stored on the server until someone does an “undo” or a workspace delete.
-
Windows Blog: “Windows 7 on Track to Hit This Holiday Season”
This is good news!
-
Load jQuery Dynamically
Sometimes you have to load jQuery, but you don’t know if it has already been referenced somewhere else in the website.
-
TFS Work Item Changed Notification: Customizing the URL for Team System Web Access
This has been explained a bunch of times – most notably here – I just thought I would capture here what I did to update our TFS instance to solve this issue.
-
Using the Generic Dictionary with JSON web services…
If you want to pass a name/value collection of untyped data to a webservice with JSON, do it like this guys, Joost van Schaik, says:
-
Detect a security exception when using FormsAuthentication
If you are using the web.config to determine security for aspx pages, you may have noticed that you don’t get the chance to determine whether a security exception has been thrown. The user will simply be return to the login page with a ReturnUrl query string pointing back to the url they were trying to access.
-
TFS Quick Tip: Use HTML in the History field for Work Items
I have just been editing the project templates to enable HTML in the description field. As it turns out, the description field is locked down as plain text.
-
LINQ-SQL: Why I Love it and why I hate it
Love it:
-
Force IE7 Compatibility Mode in IE8 with IIS settings
There a ton of examples on the web of how you can force IE8 into IE7 compatibility mode using a meta tag in the header.
-
Don’t use alert() on AJAX webservice errors!
Even if you want the user to be notified of the fact that an AJAX webservice call has errored out, don’t use an alert() to do it.
-
LINQ-SQL – Incorrect results from Count() from Lambda expressions
Check out the following C# code:
-
Mini Video Game Review: Flower (PS3)
-
Lock your web app to 1 outgoing web service call across all threads
One of the things we see a lot of these days are web apps that call other web apps via web services, RSS, or REST APIs.
-
Put code in your blog with Windows Live Writer
This plugin for windows live writer called "Insert Code", lets you do this:
-
JQuery - get a handle on a server element in javascript without using <%= elem.ClientID %>
One of the things I see a lot of is code that looks like this:
-
VS Docs for jQuery 1.3.1
I am using jQuery for everything these days - it really is an awesome add-on to any web application, and what even better is that you can get intellisense on it for the latest version.
-
VS 2010 and deployments through IIS - MSDeploy here we come
-
IIS 7, Dynamic Compression and tons of AJAX web services means massive performance increases
-
javascript:void() will throw a javascript error - you need to use javascript:void(0)
-
TSQL - Distance in kilometers between 2 points, given the latitude and longitude
It's always good to know the distance between 2 points.
-
Control Output Caching and RegisterClientScriptInclude
Always remember that if you are using Control output caching, RegisterClientScriptInclude will NOT run if the used control is returning a cached version.
-
Binding an RSS Feed with an XmlDataSource
I'm sure this has been blogged on a zillion times before, but this is super easy. Look!
-
For WCF Services hosted in non IIS apps - add permissions for a user to change the IIS namespace reservations
If you are hosting a WCF services in a console app, windows service or any other non-IIS application, you need to listen on a particular url address. A normal user running an app or service doesn't have permission to do this unless that user is an admin (not a good thing for a wcf service). So in order to grant permission to reserve the namespace, you need to run a little command.