Archive for August, 2009

UrlMappings — An ASP.NET feature I forgot about

So, the other day I came across a situation where I needed to provide a link to a user to a specific page within my web application; but that link also required that I provided specific values for a couple query string parameters which would take them right to the data they was looking for.  I wanted to avoid the messy looking querystring at the end of the URL so I wondered if there was some way around it.  I started thinking and the first thing came to mind was a URL mapping feature. After some poking around on Bing, I was taken to a MSDN page that reminded me that ASP.NET starting with version 2.0 came will a simple url mapper that would be perfect for what I was trying to accomplish.

To get the feature to work, all you have to do was add configuration element to your web.config and then you are off and running. Here is what it looked like:

 

    <urlMappings>
      <add url="~/SomePageThatDidNotHaveToExist.aspx" mappedUrl="~/SomePageThatHasToExist.aspx?id=123&cat=somecat" />
    </urlMappings>

 

Once you place this section in the <system.web> section, all your users would have to access is the SomePageThatDidNotHaveToExist.aspx page and ASP.NET would translate that url into the actual url with the additional querystring parameters at the very end. So, I didn’t have to use any third party components since my needs were very simple. Hope you find some use for this forgotten feature. Until next time…

 

Happy Programming!

Free Education!

You know, every day I become more and more impressed about the amount of information that is freely available on the internet.  Recently, I came across two online learning sites that may help you brush up on some of those old college or high school courses and it was amazing how a little refresher will get your brain going again. The Khan Academy and MIT’s Open Courseware

As you know, MIT is one of the best technology institution in the nation and anything they can offer for free is invaluable. The Khan Academy on the other hand is not affiliated with any college or university; but the individual that provides the free resources is a MIT graduate and a Harvard Business School MBA graduate. I have enjoyed many of his math courses and he does a far better job explaining things than the majority of my undergraduate professors. 

I do intend to go back to school someday; however I have not decided on any program as yet and no doubt I would have to brush up on a few things. So these resources will come in very handy for me. I hope you find some use for these as well. There is that saying that “knowledge is power”.  Until next time…

 

Happy Learning!  :-)

Introduction to MSBUILD on dnrTV

Earlier this week I watch the latest episode of dnrTV on MSBUILD and I must say I can’t wait for part two. MSBUILD is one of this hidden gems in .NET and this tool can be a real timesaver if you know how and when to use it. If you got a hour or so to spare I would encourage you to watch this episode and maybe you will have the same reaction that I did. Until next time…

 

Happy Programming!

A little late to the game

There have been two recent releases that I have been playing around with.  First, Windows 7 was just released for MSDN subscribed members and being one, I was able to download and install within 48 hours. The download took almost 12 hrs since I had to compete with everyone else. However, take my word, it’s worth the wait. I’ve been using Windows Vista for about 2 yrs now and even though it was a nice improvement over Windows XP, it wasn’t ready when it was released and I pretty much considered it to be a BETA product. That has all changed with Windows 7 and this is what we should have gotten in the first release.

Secondly, ASP.NET MVC 2 Preview was recently relapsed for us to play around with and provided our feedback to the Microsoft developer team. I consider myself to be more of a web developer and I think this is the framework I’ve been waiting for. Don’t get me wrong, I still prefer ASP.NET Web Forms for certain projects; but if you are looking to build a Web 2.0 centric application that has SEO friendly URL’s and clean markup, then you should be using ASP.NET MVC. You can find out more information about this new release by checking out the following blogs:

Scott Gu

Phil Haack

Scott Hanselman

 

I would also recommend you subscribing each of their blogs if you want to keep up to date with ASP.NET MVC or ASP.NET in general. Until next time…

 

Happy Programming!