Posts

Showing posts from October, 2007

Browser detection with Microsoft AJAX Library

Opera can disguise itself as a MS IE or Mozilla browser (Tools > Preferences | Advanced | Network > Browser Identification). This feature lets Opera "slip through" cases where access to a website is restricted to IE or Mozilla browsers. I noticed that while Peter-Paul Koch's browser detection script correctly identifies Opera even if a fake browser id is set, it is misreported by the Microsoft AJAX Client Library due to the way the browser detection code is implemented in MicrosoftAjax.js . Related: HOW TO precisely detect the browser version for IE 5 or higher

Learning resources on Design Patterns for .NET Developers

A movement is pioneered by men of words, materialized by fanatics and consolidated by men of action - Eric Hoffer MSDN Webcast: Design Patterns in .NET (Level 200) by Craig Utley Discover the Design Patterns You're Already Using in the .NET Framework Design Patterns for ASP.NET Developers, Part 1: Basic Patterns Design Patterns for ASP.NET Developers, Part 2: Custom Controller Patterns Design Patterns for ASP.NET Developers, Part 3: Advanced Patterns Exploring the Observer Design Pattern Exploring the Singleton Design Pattern Enterprise Solution Patterns Using Microsoft .NET Design Patterns Quick Reference Common Design Patterns screencast on dnrTV  

TechMela-on-the-Road presentations are available online

For those who missed TechMela (which is a mix of various tech events including the yearly TechEd) in Mumbai, there was a condensed version of it called TechMela-on-the-Road that was held in 4 cities including Hyderabad. There were 2 tracks: Enterprise Business Applications & Web Applications, conducted simultaneously. In case you missed the road show or wish to catch up on the action in the Track you didn't attend, the presentations are available online for downloading . I attended the full-day event at the Microsoft Campus in Hyderabad last month & it was a day well-spent. I had the pleasure of meeting a few Hyderabadi MVPs & former MVPs who are now Technical Evangelists & speakers at the event. The goodies I came home with included a nice DVD of selected Articles, Videos, Starter Kits etc on ASP.NET & related topics.

HOW TO download files programmatically using ASP.NET

There are 5 choices : Direct Access Response.WriteFile Response.BinaryWrite and Response.OutputStream.Write ISAPI Filters Response.TransmitFile (new in ASP.NET 2.0) "..use TransmitFile .. if you plan on serving a file more than once. TransmitFile is very efficient because it basically offloads the file streaming to IIS including potentially causing the file to get cached in the Kernal cache (based on IIS's caching rules)."

Google Reader - the online/offline Feed Reader

I like Google Reader because it's web based & it's nice to take your feeds wherever you go. You can also choose to download & view feeds offline . Since the last year the interface has improved drastically. It has many of the nice GMail features like being able to 'star' your favorite posts, keyboard shortcuts & a thoughtful Feed Search option. If you check your feeds at work, your supervisor better not see the Trends option as it contains exhaustive details of your reading pattern. The feature I really love is the 'Share' option that let's you tell the world what you've been reading & want others with similar interests to read. You can have Google Reader generate a feed of this shared list & put it as a 'widget' on any web page by embedding a piece of code they provide. You can see how I have utilized it on my code gallery . Another clever UI feature is the way older posts are fetched asynchronously as you scroll down the

HOW TO control ASP.NET's Adaptive Rendering behavior

ASP.NET server controls detect browser type automatically & render differently in modern non-IE browsers like Opera & Firefox. Sometimes this may be undesirable. For instance, a textbox server control with the property AutoCompleteType="Disabled" like so: < asp : TextBox id ="txtSecret" runat ="server" AutoCompleteType ="Disabled" > </ asp : TextBox > is rendered as this in IE 6 - < input name ="txtSecret" type ="text" autocomplete ="off" id ="txtSecret" /> whereas it will adaptively render without the autocomplete attribute in Firefox 2.0 like this - < input name ="txtSecret" type ="text" id ="txtSecret" /> Although the autocomplete attribute is a non-standard HTML property it is supported in Firefox . So how do we make this attribute show up in Firefox? By setting the @ Page directive's ClientTarget property to "uplevel

Yours declaratively, GridView

Any ASP.NET developer will agree that the GridView control is like a DataGrid on steroids. Complex functionality can be achieved by setting GridView properties declaratively instead of writing complex code as in the DataGrid days. There are 2 thoughtful properties that handle the case when the data source has no rows to bind or when a particular row has an empty field. GridView. EmptyDataText property can be used to set the text to render in the GridView when bound to an empty data source. GridView's column field type BoundField has a NullDisplayText property which can be used to assign an alternative text value when a bound field's value is null. < asp : GridView ID ="GridView1" .. EmptyDataText ="There are no data records to display."> < Columns > < asp : BoundField .. NullDisplayText ="n/a" /> .. (Code formatted with CSAH )