The Curious <HEAD/>

Download Visual Studio 2010 and .NET4 Beta 2

Posted in ASP.NET by 2leggedspider on October 21, 2009

Download for free @ http://www.microsoft.com/visualstudio/en-us/try/default.mspx

Make sure you check out the VS 2010 and .NET 4 Series to stay close to whats new in Visual Studio 2010 and .NET 4

…and also VS10 Beta 2 From an ASP.NET MVC Perspective

Overview of Google Friend Connect

Posted in General, Web Tech by 2leggedspider on October 15, 2009

Learn how Google Friend Connect lets you grow traffic by easily adding social features to your website. For more info, visit http://www.google.com/friendconnect

Google Wave Overview

Posted in General by 2leggedspider on October 15, 2009

Product managers, Stephanie and Greg explain many of the features of Google Wave. Learn more at http://wave.google.com

Tagged with: , ,

Taking your Site from One to One Million Users by Kevin Rose

Posted in General by 2leggedspider on October 14, 2009

In this talk from FOWA London (bit.ly/fowa-london-09) Kevin shares the secrets to digg.com and wefollow.com explosive user growth. He covers nine unique strategies that turn passive users into passionate advocates.

You’ll learn:

1. How to encourage users to tweet about your app
2. The concept of “The Circle of Life” in web apps and how it affects you
3. Growing your userbase: What worked and what didn’t for digg, WeFollow and Pownce
4. And more …

Trip to Himachal, Delhi and Agra

Posted in Photography, Travel by 2leggedspider on October 1, 2009

Some of the pictures I took during my trip to Himachal, Delhi and Agra recently

On the way to Rohtang Pass, Himachal

On the way to Rohtang Pass, Himachal

India Gate, New Delhi

India Gate, New Delhi

India Gate - close up

India Gate - close up

Lotus temple, Delhi

Lotus temple, Delhi

Qutb Minar, Delhi

Qutb Minar, Delhi

Qutb Minar and the Iron pillar

Qutb Minar and the Iron pillar

Taj Mahal, Agra - what a monument!

Taj Mahal, Agra - what a monument!

There are couple of more pictures which I took with my mobile camera. I’ll upload them later

Tagged with: ,

Posted in Photography by 2leggedspider on June 25, 2009

I was delightfully surprised to find the cactus in my balcony blooming with a bright yellow flower. I immediately took out my Nokia N82 to capture the beauty.

A good treat in the morning. Alas it lasted only for a day

A good treat in the morning. Alas it last only for a day

Tagged with: , , , ,

I search for it and ‘Bing’ there it is…almost

Posted in General by 2leggedspider on June 11, 2009

I’ve been using Bing, the worlds first decision engine for the past one week. I’ve set it up as my default search engine in Chrome(and its not complaining :) ). I like the images and videos section for the way it displays the search results and the ability to view or play videos inside the interface. I wouldn’t say the search results are better or even close to Google but to be fair we need to wait and see as it is still rolling out worldwide.

I guess you would have tried Bing already, if not give it a go. Here is an article on how you can set up Bing as the default search engine in various browsers http://tinyurl.com/ldjntp

Happy Binging :)

Changing the default View Location in ASP.NET MVC

Posted in ASP.NET by 2leggedspider on June 10, 2009

After 8 hours of training in ASP.NET MVC by a guy from Microsoft I starting revisiting the ways in which I’ve implemented some of the functionality in my existing project done using MVC. The training was just a walkthrough of what I already know about ASP.NET MVC from the internet. One of the questions I put forth to the trainer, which he termed as interesting was, how to change the default view location in MVC. Apart from his I’ll get back to you on this answer, one of my colleagues in the room was vociferous in declaring that it is not possible at all as none of the MVC tutorials talk about it :-|

I googled and binged for answers and found few…

I found this post Organize your views in ASP.Net MVC very useful in scenarios where I have more than one Controller which needs to share the same View location.

I wanted to check if there are any other ways of doing the same and so I twittered Scott Hanselman, the guy himself to find if he can give me any pointers and he replied…

shanselmanR @2leggedspider Derive from WebFormsViewEngine, override just FindView(). Look at the NerdDinner code on Codeplex at the MobileViewEngine.

He was talking about this piece of code in NerdDinner.

public class MobileCapableWebFormViewEngine : WebFormViewEngine
	{
		public override ViewEngineResult FindView(ControllerContext controllerContext, string viewName, string masterName, bool useCache)
		{
			ViewEngineResult result = null;
			var request = controllerContext.HttpContext.Request;

			//This could be replaced with a switch statement as other advanced / device specific views are created
			if (UserAgentIs(controllerContext, "iPhone"))	{
				result = base.FindView(controllerContext, "Mobile/iPhone/" + viewName, masterName, useCache);
			}

			// Avoid unnecessary checks if this device isn't suspected to be a mobile device
			if (request.Browser.IsMobileDevice)
			{
				//TODO: We are not doing any thing WinMobile SPECIAL yet!

				//if (UserAgentIs(controllerContext, "MSIEMobile 6"))	{
				//  result = base.FindView(controllerContext, "Mobile/MobileIE6/" + viewName, masterName, useCache);
				//}
				//else if (UserAgentIs(controllerContext, "PocketIE") && request.Browser.MajorVersion >= 4)
				//{
				//  result = base.FindView(controllerContext, "Mobile/PocketIE/" + viewName, masterName, useCache);
				//}

				//Fall back to default mobile view if no other mobile view has already been set
				if ((result == null || result.View == null) &&
								request.Browser.IsMobileDevice)
				{
					result = base.FindView(controllerContext, "Mobile/" + viewName, masterName, useCache);
				}
			}

			//Fall back to desktop view if no other view has been selected
			if (result == null || result.View == null)
			{
				result = base.FindView(controllerContext, viewName, masterName, useCache);
			}

			return result;
		}

		public bool UserAgentIs(ControllerContext controllerContext, string userAgentToTest)
		{
			return (controllerContext.HttpContext.Request.UserAgent.IndexOf(userAgentToTest,
							StringComparison.OrdinalIgnoreCase) > 0);
		}
	}

Though the above code helps in detecting if the user is accessing the site from a mobile device and redirect the request to a particular view location, you can customize it for your needs.

Btw, if you have not checked NerdDinner yet, I suggest you should. It is one of the best ways to learn MVC.

Another approach I found useful is from Phil Haack Grouping Controllers with ASP.NET MVC.

Let me know if you came across any other approach or best practice relevant to this.

Tagged with: ,

Scott Hanselman talks about MVC 1.0 and NerdDinner.com at Mix09

Posted in ASP.NET, C#, SQL, Web Tech by 2leggedspider on March 22, 2009

A really great presentation by Scott Hanselman demonstrating how he created NerdDinner.com using MVC 1.0. In this 70 minutes presentation, Scott demonstrates how we can build a real Web site with ASP.NET, ASP.NET AJAX, Authentication, Authorization, MVC, Microsoft SQL Server and jQuery. Long video, but really worth it.

CodePlex Project: http://nerddinner.codeplex.com

Tagged with: , ,

Tagging and Folksonomy database schema

Posted in folksonomy by 2leggedspider on July 5, 2007

Here is a nice presentation on designing a database schema for tagging.