Author Archive

April 18, 2008 3

Three quick ways optimize AJAX driven websites in ASP.NET

By in Uncategorized

Recently I was involved in a project where I had to make heavy use of AJAX. I realized there are a few simple things you could do to improve performance. 1) Combine scripts <ajaxToolkit:ToolkitScriptManager ID=”TSM1″ runat=”Server” EnablePartialRendering=”true” CombineScriptsHandlerUrl=”~/CombineScriptsHandler.ashx” /> As the name of the property suggests, it will pretty much combine all the needed JS [...]

Tags: ,

April 8, 2008 0

Request.Browser.Crawler

By in Uncategorized

In my previous post about exception logging, I show how to log several different parameters related to the exception in the database. Request.Browser.Crawler is one of them and its used to track browser crawlers. It warrants its own separate entry since it requires some extra bit of setup in the web.config to get it to [...]

Tags: ,

April 8, 2008 0

Exception Logging Using The Database

By in Uncategorized

This is a simple technique I use to log exceptions in all my web applications. First lets start by adding the following to the web.config: <appSettings> <add key=”LogUnhandledExceptions” value=”true”/> </appSettings> Second, we add the following bit inside the Application_Error event of the Global.asax file. This will capture all the unhandled exceptions and log them into [...]

Tags:

March 29, 2008 1

The Mysterious “Invalid Parameter Used” Error

By in Uncategorized

Recently I was trying to write a little C# function for cropping images. I expected it to be a quick 5 minute task but I ended up spending a huge amount of time getting it to work correctly. I kept getting a very stubborn and mysterious error – “Invalid Parameter Used” – whenever I tried [...]

Tags: ,

March 12, 2008 0

How to unzip files in .NET using SharpZipLib

By in Uncategorized

SharpZipLib is a great open source library for handeling all kinds of gzip/zip compression/decompression. More Info – http://www.icsharpcode.net/OpenSource/SharpZipLib/ In the following example I’m passing the HtmlInputFile object directly into the ZipInputStream to decompress the PostedFile and save its contents on the server. . . using System.IO; using ICSharpCode.SharpZipLib.Zip . . private void UnzipAndSave(HtmlInputFile objFileUpload) { ZipInputStream s = new [...]

Tags: ,

March 12, 2008 7

How to manipulate video in .NET using ffmpeg

By in Uncategorized

In this case I’m resizing the video and converting it to FLV format. For more ffmpeg commandline options - http://ffmpeg.mplayerhq.hu/ffmpeg-doc.html private void ConvertVideo(string srcURL, string destURL) { string ffmpegURL = “~/project/tools/ffmpeg.exe”; DirectoryInfo directoryInfo = new DirectoryInfo(Path.GetDirectoryName(Server.MapPath(ffmpegURL))); ProcessStartInfo startInfo = new ProcessStartInfo(); startInfo.FileName = Server.MapPath(ffmpegURL); startInfo.Arguments = string.Format(“-i \”{0}\” -s 368×216 -aspect 1.7777 \”{1}\”", srcURL, destURL); startInfo.WorkingDirectory = [...]

Tags: ,

February 16, 2008 0

Event Driven Developement using ASP.NET & C#

By in Uncategorized

Until recently I wasn’t entirely familiar with the concepts of Event Driven Programming, Event Bubbling, etc. Being a .NET developer I’ve been exposed to events and delegates but I never really understood the concept in its entirety. Somehow I had a hard time readily finding good sources online focusing on event driven programming especially using [...]

Tags:

February 2, 2008 0

10 ASP.NET Performance and Scalability Secrets

By in Uncategorized

Very good article. Covers all the following topics: ASP.NET Pipeline optimization ASP.NET Process configuration optimization Things you must do for ASP.NET before going live Content Delivery Network Caching AJAX calls on browser Making best use of Browser Cache On demand progressive UI loading for fast smooth experience Optimize ASP.NET 2.0 Profile provider How to query [...]

Tags: ,

January 21, 2008 2

The dumbing-down of programming

By in Uncategorized

Very interesting article in Ekinoderm : Doctors Robert Dewar and Edmond Schonberg (Professors Emeritus at NYU in Computer Science) recently penned a rather scathing paper about the sorry state of Computer Science education in the United States today. In it, we see the usual laments that Java is dumbing down Computer Science curricula and that [...]

Tags: ,

January 17, 2008 0

The veil is lifted

By in Uncategorized

Scott Guthrie announced today that they are finally releasing the source code to the .NET Framework libraries. So far you can now browse and debug the source code for the following .NET Framework libraries: .NET Base Class Libraries (including System, System.CodeDom, System.Collections, System.ComponentModel, System.Diagnostics, System.Drawing, System.Globalization, System.IO, System.Net, System.Reflection, System.Runtime, System.Security, System.Text, System.Threading, etc). ASP.NET (System.Web, System.Web.Extensions) [...]

Tags: