Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I have a question to ask and maybe some of you will think it's lame, but I hope someone will get me on the right track.

So I've been programming for quite some time now. I started programming when I was about 13 or so on Delphi, but when I was about 17 or so I switched to C# and now I really like to program with it, mostly because it's syntax is very appealing to me, plus managed code is very good.

So it all was good and fun but then I had some job openings that I of course took, but the problem with them is that they all are about web programming. And I had to learn PHP and MVC fundamentals. And I somewhat did while building applications using CI and Kohana framework. But I want to build websites using ASP.NET because I like C# much, much more than PHP.

TL;DR

I want to know ASP.NET MVC but I don't know where to start. What I want to start with is build some simple like CMS. But I don't know where to start. Do I use same logic as PHP? What do I use for DB connections?

And also, if I plan to host something that is build with ASP.NET MVC3 on a hosting provider do I need to buy some kind of license?

share|improve this question

closed as primarily opinion-based by gnat, MichaelT, GlenH7, Dynamic, Dan Pichelman Jul 15 '13 at 21:08

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise.If this question can be reworded to fit the rules in the help center, please edit the question.

3 Answers 3

up vote 3 down vote accepted

There is a good tutorial on ASP.Net MVC 3 here: Creating a MVC 3 Application with Razor and Unobtrusive JavaScript

I learned on the nerd dinner tutorial, which was a bit more thorough. It uses ASP.Net MVC 2... Everything you learn on this tutorial, however, will be applicable MVC 3. The nerd dinner tutorial can be found here: NerdDinner tutorial.

This nerd dinner tutorial uses the standard aspx "rendering engine". If you are at all familiar with asp.net, then this will be the standard markup/code that you are used to. The ASP.Net MVC 3 tutorial uses razor - the new rendering engine made specially for MVC 3. It allows for much more compact code over the standard rendering engine.

share|improve this answer
    
Thanks man. Well I know how to render view, how to validate input etc. The part that I'm confused about is the so called "model" part. Database access and such... I'll look at NerdDiner, looks that it has what I need. –  Qmal Mar 20 '11 at 16:35
    
A model can be just a plain object - it is just a way to get data (typically properties) into a view. The NerdDinner tutorial will show you how to use Linq to SQL for retrieving data and sending that data to a view. Good luck! –  jlnorsworthy Mar 20 '11 at 16:40
    
Thanks, but NerdDiner also raises a question. They create DB in Visual Studio itself as *.mdf file. When I want to deploy site, let's say it's a shop or something I do same thing? Or I should instead connect to some database server? Or I can use this *.mdf file but when it's time to deploy I just import my *.mdf into SQL server and change connection string on my app? –  Qmal Mar 20 '11 at 16:52
    
Regardless of how you connect to your local development database (you can leave it in VS, or you can attach to your SQL server instance and change your conn string) you'll probably get connection details from your host for a new server/database to use. Just update your conn string when you deploy. –  jlnorsworthy Mar 20 '11 at 17:31

Read Steven Sanderson's book, and follow along in Visual Studio.

...In this book, the core model-view-controller (MVC) architectural concepts are not simply explained or discussed in isolation, but are demonstrated in action. You’ll work through an extended tutorial to create a working e-commerce web application that combines ASP.NET MVC with C# language features and unit-testing best practices...

What you’ll learn

  • Gain a solid architectural background to ASP.NET MVC 2, including MVC and REST concepts.
  • Explore the entire ASP.NET MVC Framework and take a detailed look at the official MVC development toolkit.
  • See how it works with test-driven development in action.
  • Capitalize on your existing knowledge quickly and easily through translation and comparison of features in classic ASP.NET to those in ASP.NET MVC.
  • Learn about the latest security and deployment issues, including IIS 7.0.

Who this book is for

This book is for web developers with a basic knowledge of ASP.NET and C# who want (or need) to start using the ASP.NET MVC 2 Framework...

share|improve this answer
    
Seconded. It's an excellent book, which not only covers ASP.NET MVC, but also includes practical examples of test-driven development and dependency injection. The three-chapter SportsStore tutorial is worth the price of admission. –  Kyralessa Mar 20 '11 at 20:00

There is a wealth of information on MSDN: http://msdn.microsoft.com/en-us/library/gg416514(v=VS.98).aspx

TekPub also does a good online course: http://tekpub.com/view/aspmvc/1 for under $30

There is no special licence fee for ASP.Net MVC

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.