Home
Q&A
Education
Technology
Credit
General
Health
Insurance
Questions
Ask a Question
What is difference between MVC and Web Forms?
Home
Education
What is difference between MVC and Web Forms?
asked
Apr 5, 2021
in
Education
by
JackTerrance
What is difference between MVC and Web Forms?
c-sharp-interview-questions
asp-net-mvc-interview-questions
1
Answer
0
votes
answered
Apr 5, 2021
by
JackTerrance
ASP.Net MVC / Web Forms difference
The following are some difference.
ASP.Net MVC
ASP.Net Web Forms
View and logic are separate, it has separation of concerns theory. MVC 3 onwards has .aspx page as .cshtml.
No separation of concerns; Views are tightly coupled with logic (.aspx.cs /.vb file).
Introduced concept of routing for route based URL. Routing is declared in Global.asax for example.
File-based routing .Redirection is based on pages.
Support Razor syntax as well as .aspx
Support web forms syntax only.
State management handled via Tempdata, ViewBag, and View Data. Since the controller and view are not dependent and also since there is no view state concept in ASP.NET, MVC keeps the pages lightweight.
State management handled via View State. Large viewstate, in other words increase in page size.
Partial Views
User Controls
HTML Helpers
Server Controls
Multiple pages can have the same controller to satisfy their requirements. A controller may have multiple Actions (method name inside the controller class).
Each page has its own code, in other words direct dependency on code. For example Sachin.aspx is dependent on Sachin.aspx.cs (code behind) file.
Unit Testing is quite easier than ASP.Net Web forms Since a web form and code are separate files.
Direct dependency, tight coupling raises issues in testing.
layouts
Master pages
Related questions
0
votes
Q: How do you implement Forms authentication in MVC?
How do you implement Forms authentication in MVC?...
asked
Apr 5, 2021
in
Education
by
JackTerrance
c-sharp-interview-questions
asp-net-mvc-interview-questions
0
votes
Q: What is the difference between MVP, MVC and MVVM?
What is the difference between MVP, MVC and MVVM?...
asked
Apr 9, 2021
in
Education
by
JackTerrance
c-sharp-interview-questions
asp-net-mvc-interview-questions
wpf-interview-questions-and-answers
0
votes
Q: What is the difference between Server.Transfer and Response.redirect?
What is the difference between Server.Transfer and Response.redirect?...
asked
Apr 7, 2021
in
Education
by
JackTerrance
c-sharp-interview-questions
asp-net-mvc-interview-questions
0
votes
Q: What is the difference between HttpContext.Current.Items and HttpContext.Current.Session in ASP.NET?
What is the difference between HttpContext.Current.Items and HttpContext.Current.Session in ASP.NET?...
asked
Apr 7, 2021
in
Education
by
JackTerrance
c-sharp-interview-questions
asp-net-mvc-interview-questions
0
votes
Q: What is the Difference between session and caching?
What is the Difference between session and caching?...
asked
Apr 7, 2021
in
Education
by
JackTerrance
c-sharp-interview-questions
asp-net-mvc-interview-questions
0
votes
Q: What is Bundling and Minification in MVC?
What is Bundling and Minification in MVC?...
asked
Apr 5, 2021
in
Education
by
JackTerrance
c-sharp-interview-questions
asp-net-mvc-interview-questions
0
votes
Q: What is MVC?
What is MVC?...
asked
Apr 6, 2021
in
Education
by
JackTerrance
c-sharp-interview-questions
asp-net-mvc-interview-questions
0
votes
Q: What is Scaffolding in MVC?
What is Scaffolding in MVC?...
asked
Apr 5, 2021
in
Education
by
JackTerrance
c-sharp-interview-questions
asp-net-mvc-interview-questions
0
votes
Q: What are the methods of handling an Error in MVC?
What are the methods of handling an Error in MVC?...
asked
Apr 5, 2021
in
Education
by
JackTerrance
c-sharp-interview-questions
asp-net-mvc-interview-questions
0
votes
Q: What are the Folders in MVC application solutions?
What are the Folders in MVC application solutions?...
asked
Apr 5, 2021
in
Education
by
JackTerrance
c-sharp-interview-questions
asp-net-mvc-interview-questions
0
votes
Q: What is Database First Approach in MVC using Entity Framework?
What is Database First Approach in MVC using Entity Framework?...
asked
Apr 5, 2021
in
Education
by
JackTerrance
c-sharp-interview-questions
asp-net-mvc-interview-questions
0
votes
Q: What is Validation Summary in MVC?
What is Validation Summary in MVC?...
asked
Apr 5, 2021
in
Education
by
JackTerrance
c-sharp-interview-questions
asp-net-mvc-interview-questions
0
votes
Q: What is Output Caching in MVC?
What is Output Caching in MVC?...
asked
Apr 5, 2021
in
Education
by
JackTerrance
c-sharp-interview-questions
asp-net-mvc-interview-questions
0
votes
Q: What is Razor View Engine in MVC?
What is Razor View Engine in MVC?...
asked
Apr 5, 2021
in
Education
by
JackTerrance
c-sharp-interview-questions
asp-net-mvc-interview-questions
0
votes
Q: What is Route Constraints in MVC?
What is Route Constraints in MVC?...
asked
Apr 5, 2021
in
Education
by
JackTerrance
c-sharp-interview-questions
asp-net-mvc-interview-questions
...