, WhatDoYouMean wrote

I have read the descriptions and features of them in www.asp.net website. Still confused about "Web pages" vs "Web forms" vs "MVC".

  1. Web pages is some kind of "view" sitting on top of MVC?
  2. I see that there is more than one MVC "version", is that the case for "Web forms" as well or is there only "one" "Web forms"?
  3. If I use MVC "version 3", when "version 4" comes out, do I need to rewrite a lot of stuff? I know MVC 4 is not out ( or 5, not sure ) but how was it from version 1&2 into version 3. Lots of change and rewrite to make it "version 3"?
  4. Is MVC just a "way of writing applications" or is it a specially made "tool" so to speak?
  5. Which one of those from the coding side, "looks more like" PHP?
  6. Which one do you personally prefer, and why?

Sorry if my questions seem rather stupid but I am almost completely ignorant regarding ASP.NET.

Thanks!

1) No. You can use Web Pages completely by itself.

2) Web Form usually does not evolve because it is pretty old technology. What it can evolve is already been done, sort of.

3) I cannot comment on that, but, shouldn't be too bad.

4) MVC is a pattern, but, yeah, you can say it is a template / tool that MS provides that follows the MVC pattern.

5) Razor, it doesn't matter you use Web Pages or MVC4, you can use Razor, which is better than PHP to indicate server side code.

6) Razor + Web Pages. Honestly MVC has really high learning curve and it is quite overkill in many cases. Web Pages is a lot simpler. Razor + Web Pages = simple dynamic HTML generation and program in C# at server side. If you want to pass model around, you can always write the .cs classes and pass those around between method parameters. MVC seem to be able to pass model around among pages? (I am not really familiar with MVC, just trying the tutorial a little). The problem with MVC is you spam 3 files for a page, but, sometimes you are only doing simple stuff that doesn't really need to spam 3 files all over the places.

6.5) You want to use MVC in co-op environment, where the view can be made by different person. If you are the only person, or you think View should be modified at CSS level, then, Web Pages is more suitable.

7) Extra note, try this fun Razor code

@{

@:@myvariable

}

This is a funny way to write value of myvariable within a @{} code block. It is shorter than wrapping the variable with <text></text>.

8) Reminder, you can use Razor on MVC. Web Pages is just a library that you can use to access URL data, form data, connect to SQLCE and etc. You can actually use the same library in MVC as well.