Goober
Goober

Reputation: 13506

ASP.Net VS ASP.Net MVC

Now this isn't a question as to which of the technologies is better, since they both have their relevant uses for different scenarios.

My question is regarding the syntax of the two. How do their syntax's differ?

Upvotes: 2

Views: 386

Answers (4)

Khanzor
Khanzor

Reputation: 5000

MVC and Webforms use different HttpHandlers in order to expose programmatic features to developers to handle requests.

MVC gives you much greater control over the html that you put on the page (as you will write almost all of it), whereas Webforms (aka ASP.Net) will render Html to the page automatically.

Both use the same syntax, but you don't have access to server controls in MVC (e.g. <asp:DataGrid />) which can save you time with features such as databinding, at the cost of having html that looks a little like vomit.

You will also find that you won't need special cases in your page lifecycle events (as that doesn't exist in MVC) to stop things from firing when you handle an event.

Upvotes: 2

Jalpesh Vadgama
Jalpesh Vadgama

Reputation: 14216

There is no better things both are having pros and cons of their own. Its depends on your need that how you want to develope this application. Both are having its advantage or disadvantage.

Upvotes: 0

mandreko
mandreko

Reputation: 1796

The syntax is pretty much the same. You are still writing C# or VB code. The only difference is you have no code-behind, as it's separated into the controllers. Your views may contain some logic in them, in the form of ASP tags ( <%= %> ).

Upvotes: 2

David Brown
David Brown

Reputation: 36239

ASP.NET MVC (as the name suggests) is still ASP.NET. It just adds an extra layer that implements the Model-View-Controller method. Views are just plain old ASPX pages, controllers are just plain old C#/VB.NET classes that inherit from a Controller class. The only major difference (aside from the whole MVC way of thinking, of course) is that code-behind files aren't used by default. You can still create them yourself, though.

Upvotes: 5

Related Questions