Archive for February, 2008

February 29th, 2008

Congratulations Penn State THON and Alpha Phi Delta

I would like to congratulate the Penn State IFC/Panhellenic Dance Marathon (THON™), it is the largest student-run philanthropy in the world, and this past weekend they raised $6,615,318.04 for children with cancer. And a special congratulations to my fraternity Alpha Phi Delta, Chi Chapter, for participating and helping to raise money for this great cause.

Tags: , , , , , , , , ,

Posted in News, Personal | kick it on DotNetKicks.com | Bookmark | View blog reactions | No Comments »

February 27th, 2008

ASP.NET MVC Route Validation and SEO

Recently I have been using the ASP.NET MVC framework for a project at work. And one of the requirements was that certain data inputed in to the URL be tightly verified. I originally thought that data was verified by the type specified in the ControllerAction, however I came to find out that it wasn’t. So if you have say a page number and the user enters a letter in the URL the application just proceeds on it’s marry way. For example on the Kigg site:

  1. http://kigg.dotnetslackers.com/Story.mvc/Category/Lifestyle/1
  2. http://kigg.dotnetslackers.com/Story.mvc/Category/Lifestyle/a
  3. http://kigg.dotnetslackers.com/Story.mvc/Category/Lifestyle/
  4. http://kigg.dotnetslackers.com/Default.aspx

I am not sure yet if this is because Kigg is implemented with a int? and any failure of the parsing results in a null. But that wouldn’t explain the 3rd result in which Kigg returns the category as if it was the 4th result. I would expect that the 3rd result should return the same results as the 1st result. This setup can results in many SEO issues where I can inject keywords in to the URL with malicious intent and still have it resolve correctly. For example:

  1. http://kigg.dotnetslackers.com/Story.mvc/Category/Lifestyle/coderjournal

So my recommendation to my readers is to also implement a URL Rewriter to force normalization on to the MVC URLs. I am personally using my own URL Rewriter on this project that I am creating to better control my inputs, by providing type validation, into my application. At the very least use the built in verification and don’t put null in the defaults.

RouteTable.Routes.Add(new Route {
	Url = "[controller]/[action]/[page]",
	Defaults = new { controller = "Home", action = "Index", page = 1 },
	RouteHandler = typeof(MvcRouteHandler),
	Validation = new { method = "GET", page = "[0-9]+" }
});

The Validation property that you see on the last line above allows the type of HTTP Method allowed POST or GET usually. And the other properties are similar to what you do with the Default only they are RegEx statements that validate the specific part of the URL.

Really what I would like to see from ScottGu and the rest from the MVC framework is a more extensible Route object or RouteTable. I was really surprised that I wasn’t able to overload the handling of the URL in the MVC framework. Don’t get me wrong the team has done a great job hitting 95% of the potential needs of the development community. However if you fall in that 5% you are either out of luck, or forced to create a new Module, Controller, RouteTable, Route, and a whole host of supporting objects. For instance if I wanted to give the users of my URL Rewriter and Reverse Proxy a common interface that they can both do their advanced URL Rewriting and Reverse Proxying and their MVC Action/Controller setup. I wouldn’t be able to do it unless I basically reimplemented the URL handling of the MVC framework. I might end up doing that in the future, but I will probably wait until the Gold Version of MVC is released. If this was a perfect world I would probably implement some syntax in my URL Rewriter Rules file that looked like:

# if not feed burner requesting
RewriteCond %{HTTP_USER_AGENT} !^FeedBurner.*$
# rearrange old structure
RewriteRule ^/<?'controller'([a-z]+)>/index.html$  /$1/List/page$2.html [C]
# in to new MVC model
RewriteRule ^/<?'controller'([a-z]+)>/<?'action'([a-z]+)>/page<?'page'([0-9]+)>.html$  {controller="Home",action="List",page=1} [MVC,NC,L]

But that is just me making a wish for the future of MVC extensibility. All that I would need to accomplish this task is a little more flexibility in the URL handling. If anybody from the MVC wants to talk to me more about my requirements please feel free to contact me.

Really the last thing, I imagine, that the MVC team would want to cause is more SEO problems than are already created by uneducated developers.

Tags: , , , ,

Posted in ASP.NET, C#, Personal | kick it on DotNetKicks.com | Bookmark | View blog reactions | 1 Comment »

February 25th, 2008

What I Learned About MVC On Day One

I am really blown back about how fast and easy MVC is to develop with.  I know the guys at Microsoft do a good job with their .NET coding, but I am really impressed by the forethought they put in to MVC.  It builds on top of the standard ASP.NET package, but does it in such a way that makes it lean on top of the already feature-rich (read bloated) ASP.NET Page object.  It really doesn’t feel like I have all that baggage anymore.

These are the following links that got me started designing my very first MVC application.

Keep a watch on my blog about for my posts about Unit Testing MVC and using Validators in the Routing table.  Also I am currently exploring if it is possible for my URL Rewriter and Reverse Proxy to be used in combination with the MVC Routing table.  I will keep you informed.

Tags: , , , , ,

Posted in ASP.NET, C# | kick it on DotNetKicks.com | Bookmark | View blog reactions | 8 Comments »

February 25th, 2008

Google Lets You “Chatback” With Your Visitors

As many of you may know I love Google Talk. I love it because of its light foot print both on my hard drive and when running in memory. I love the integration with all my Google services. And I love the flexibility that it provides. If you would like a copy of it, you can download it as part of the Google Pack. Or by it self from http://www.google.com/talk.


However the Google Talk team just gave me another reason to love Google Talk. It now allows me to have direct conversations with my visitors with a simple click of the mouse on the chat bubble you see to your left.

This new feature is called chatback and allows you to integrate Google Talk in to any website you have access to add HTML. Chatback uses the web-based Google Talk Gadget so your visitors don’t need to download anything. It opens in a new window so they can keep chatting with you even if they browse to other pages.

Of course, chatback isn’t just for blogs. You can use it on any web page that you can add HTML content to. To get started, visit the chatback start page. (This is also linked from the Google Talk homepage.) Then just copy the provided HTML snippet to your web site. Visitors will then see a badge on your site indicating your availability, and can click to start a chat with you. If there’s a time when you don’t want to be distracted, just set your online status to “busy” and visitors won’t be able to chat with you until you change your status back to “available.”

So now if you want to chat with me about anything and you see a Green dot. You have the go ahead to say hi or ask me any question you want. I may not always respond, because I sometimes forget to turn of GTalk when I am in a meeting or giving a presentation.

Tags: , , , , ,

Posted in News | kick it on DotNetKicks.com | Bookmark | View blog reactions | 5 Comments »