Last post Feb 22, 2009 04:54 PM by Luis Abreu
Feb 19, 2009 11:30 PM|nuck|LINK
I want to create a code-behind file for my view page as I've previously done in the Preview versions of the MVC.
Feb 20, 2009 03:43 AM|Augi|LINK
If you have page Index.aspx then you can try to add file Index.aspx.cs and then specify
CodeBehind attribute in Page directive (at the begin of Index.aspx).
Feb 20, 2009 09:30 AM|Luis Abreu|LINK
Don't forget to pass the inherits attribute and point it to the name of the class you've got in the class behind file.
Feb 21, 2009 11:53 AM|gerrylowry|LINK
"advantage of dropping code behind in the ASP.NET MVC RC"
nuck, you may want to rethink using CodeBehind.
I am guessing that the ASP.NET MVC team dropped
it from the RC for good reason(s).
Feb 22, 2009 05:39 AM|Luis Abreu|LINK
Yes, they've dropped it because they won't to make it hard for you to put code on the view.
well, in my opinion, you should at least get the option of addind a codebehind file when creating a new view. There are still lots of scenarios where having code on a view makes sense.
Feb 22, 2009 07:15 AM|nuck|LINK
Personally I hate inline code it makes feel like I'm using ASP or JSP. I completely realise the view should have "no code" or logic. However there are many situations where limited
logic code is required. Most of web application I’ve built recently are intranet applications which have more functionality that your garden variety website. Some of these applications actually are design to replace existing desktop applications.
Where I’m working we're investigating using MVC for some upcoming web applications. I just wondering why and I wanted the codebehind file back..
Feb 22, 2009 04:54 PM|Luis Abreu|LINK