Try Tuts+ Premium, Get Cash Back!
ASP.NET from Scratch: Routing in MVC
videos

ASP.NET from Scratch: Routing in MVC

Tutorial Details
  • Program: Visual Web Developer Express 2010 (ASP.NET MVC2)
  • Difficulty:Beginner to Intermediate
  • Estimated Completion Time: 20 minutes
Download Source Files
This entry is part 7 of 10 in the ASP.NET from Scratch Session
« PreviousNext »

In today’s episode of ASP.NET from Scratch, we’ll look into URL routing in the MVC framework, and examine how a request can be routed to a controller and action method. You’ll learn how to use constraints to gain better control over your routers, and also discuss best practices in adding routes to the route table.


Premium Members: Download this Video ( Must be logged in)

Sell ASP.NET Components on CodeCanyon

Did you know that you can sell your ASP.NET scripts and components on CodeCanyon? Simply sign-up for a free author account, and start selling!

Jeremy McPeak is jwmcpeak on Codecanyon
Note: Want to add some source code? Type <pre><code> before it and </code></pre> after it. Find out more
  • Ryan

    Great job. Routes were the thing that confused me the most with MVC, so I’m glad I finally found a tutorial that made it easy to understand. Where did you get the black editor theme for Visual Studio by the way?

    • http://www.wdonline.com Jeremy
      Author

      Howdy, Ryan.

      I downloaded it from http://studiostyles.info/. I forget which one I downloaded, but I want to say it was one of the top rated schemes.

  • Rob Henry

    Great job! I really enjoy this series and am very glad that you are taking the MVC path, as I just recently started using it and have lots to learn. Thanks again!

  • Leo

    Nice more asp.net on nettuts i can’t wait to get home to watch the screencast.

  • http://holamiamor.tistory.com Irene

    Great job. Thanks 4 sharing!

  • http://www.nexuswebsol.com Muhammad Saqib

    love to see when i get free time :)

  • http://studentkak.se Anders

    Yey, i have been refreshing net.tutslpus.com daily jsut to see if there has been a new asp.net MVC tutorial ;)

    Whats next on the agenda? I am looking forward to a more advanced screencast, maybe for setting up an API … (since that is what im working on currently).

    Anywho, great screencast, can’t wait for more :)

    Peace!

    • http://www.wdonline.com Jeremy
      Author

      Howdy, Anders.

      What exactly do you mean by “setting up an API”? If you mean an API for a component or something similar, there are a few API guidelines in an article I wrote a while back http://net.tutsplus.com/tutorials/asp-net/developing-usable-net-components/.

      • http://abergsdesign.se Anders

        Ah, i missed that tutorial. Thanks, Quite nice :)

        Well, with setting up an API i was thinking more about the whole thing, but basic.
        Like how to get, post, delete products. And maybe security.. (since that is in detail, what i’m working on during october) ;)
        If you know any articles about adding auth (perhaps with pub/priv keys) to an API, give me a hint :)

        Peace!

      • http://www.wdonline.com Jeremy
        Author

        Ahh. I see what you mean now.

        Yeah, we’ll get there. I plan on going over controllers, views, and models first, though.

  • http://www.designmango.com DesignMango

    Nice screencast thanks

  • http://www.simonfacciol.info Simon

    Have started to learn MVC lately and after a few videos and tutorials it is pretty easy to code using the new MVC method.

    Now I am reading a book to get more in-depth knowledge about MVC and .Net 4.

    Hope the next tutorial will come by soon :)

  • http://www.ewaveinfotech.com gun

    MVP Pattern is more on demand now a days. it will provide MOdel,View, Controller

    its same as N tier architecure but in GUI layer Designer works on form design and on class Developer works

  • http://cleverads.vn/ quang cao google

    great post! thanks for sharing! I’m subscribing now to your blog.

  • http://www.intensetech.com Logan

    Honestly, this tutorial needs to be re-rendered. It believe it needs to be a little more crisp, so it would be easier to read the code.

  • ramon

    Hello there

    Are there going to be more tutorials about asp its been a while and im going to suscribe to be a premium user but i dont know for how long im going to buy it, so any news about this series would be good.

    Thanks a lot.

  • http://socialvela.com dee

    really liked this tut

  • thanuja

    Hi I really like your tutorials. I tried this application after watching the video. I am getting an issue with blog routing. A 404 request specifically. Its the exact replica of your app. Below is the error displayed in the browser. Can you help me please. Thanks in advance!!

    Server Error in ‘/’ Application.
    ——————————————————————————–

    The resource cannot be found.
    Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.

    Requested URL: /2012/3/26

    ——————————————————————————–
    Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272

  • Yoosaf Abdulla

    This is turning out to be the most effective tutorials I have watched on asp.net MVC. I getting lot confident. I create applications similar ot yours and when i hit error I am able to solve them.

    Thanks a ton Jeremy.

  • http://www.facebook.com/john.weland John Weland

    This is great! I come from a more “open-source” background using Linux servers that run Apache, MySQL, and PHP (though my PHP is VERY limited). I recently started a new job working for the military as a civilian contractor and they are 110% Microsoft oriented, (Windows servers, IIS, SQL server and asp.NET). I was a little scared I wouldn’t be able to be effective in my new job, but I found this tutorial series to be absolute gold!