dotnetdevcsharp
dotnetdevcsharp

Reputation: 3980

WebForms Transferring To MVC

I was wanting to ask the following about mvc to have a better understanding.

1 What is the difference between the way webforms and action controllers work.

2 How should one coming from a webforms background convert the page_load etc button clicks etc into mvc methods and events. Its this understanding that I am lacking.

3.How do i fill controls before I was used to setting the datasource but see allot of controls using the foreach on the front end is that really code separation?.

4 I will be developing a form designer in .net webforms I was used to using panels and loading controls but I see it will be neater in mvc by using partial views would that be my best course of action. I am a senior asp.net webforms developer with over ten years experience.

I have been watching plurisight videos but they center on using sql express not server.

Upvotes: 0

Views: 83

Answers (1)

Lakshay Dulani
Lakshay Dulani

Reputation: 1775

A lot of help material you can get online about this topic.

Your first question about the way webforms and action controllers work -

In webform, you specify the code-behind file of your .aspx page and the code-behind file is the master of that page now. The browser hits the .aspx and the code behind file manages the work. But in MVC, no view file is approached; the path is matched to the respective controller and action and the action handles it. Any controller can access the View of any other Controller. There are Shared Views which are common for every controller as well.

I strongly suggest you to read at this link and this codeproject article.

Some major points will be this :

  • You wont have the RAD (Rapid Application Development) environment i.e. the drag drop support for Controls, page viewer in case of Razor, etc.
  • You wont have the basic server controls Gridview, Repeater,etc in MVC. None of the controls in MVC are bind to any controller. You can neatly pick the desired elements using Javascript and play with them.
  • You get full control over the HTML
  • What I feel is that MVC is more flexible and jQuery-able as compared to Webforms

All the best!

Upvotes: 1

Related Questions