2
Answers

What is the difference between a aspx webform, and a razor form?

Olivier Muhring

Olivier Muhring

12y
2.2k
1
I've only recently begon to develop in ASP .NET MVC 3.

On the project I'm currently working on I started to work on a couple of screens. To create a view Visual Studio 2010 offers 2 options: either in classical aspx, or in razor webforms.

Most articles, or booksections I read about mvc seem to have a preference for razor webforms, and consider aspx to be a "only if you really have to" option.

Basing myself on what I read, I started working on a couple of screens, using razor webforms. My colleague on the project however chose to develop her screens in aspx. To stay on the same track I've started reworking all my screens in aspx.

Strangely enough... the same code executed with a razor webform executes flawlessly, while when I switched to aspx, it suddenly generated an error. Now, don't get me wrong.. it was a valid error, but I wonder... why didn't the error show up whilst I was working in razor?

Which brings me to my actual question: what is the actual difference between the 2? And when do we use what, or is it just - as it appeared to be in the articles - a personal choice?

Answers (2)