MVC and ASP.NET forms part II

Well, I was very happy with the adjustment I add to maverick until I check page postback. This check failed due to inner implementation of maverick. So I think my search for MVC framework that support Postback ended without any results. I understand the conflict between classic MVS and postback applications that required preserving data form page call to call. I think that the main reason for that clash is porting of Java MVC framework to .NET, instead of building MVC framework suitable for .NET.

 

In the end of the day MVC is all about separating application logic and data from application presentation layer and that goal can be achieved for postback application as well. MVC also supplies the basic plumbing between application blocks living the programmer to write just application blocks, but implementation of application plumbing doesn't cause any problem.

 

I'll be happy to hear about MVC implementation that decoupled Front controller, Commands, Controllers and pages but if I won't find one I'm very close to write my own. What I have in mind is :

 

a)      Base page that implement setting of command of page request. I can't use the Form action so I thought I can catch Commands by query string or/and hidden Form field. The base page will be responsible for translate command property to hidden field hold page request action.

b)      Instead of IHttphandler request will be catch in Application_beginRequest event. Application_beginRequest will find page command and call command 'Do' method which will run XML definitions set for the given command. Commands can call controllers, specify action by controller return values and/or redirect the request to specify View.

c)      Controller return data will be placed in Context for Page event usage. After Application_beginRequest all command tasks perform, data available in Context for page  and the process chain continue to the request page or redirect to other page (depends on command definitions)

d)      Pages still run server side event but event doesn't call any application block they just access Context to get data they should render to end users.

Published Sunday, March 21, 2004 11:58 PM by nattYGUR

Comments

# re: MVC and ASP.NET forms part II

Sunday, March 21, 2004 4:41 PM by Matt Berther
Just out of curiousity, have you seen this one? Or is this the one youre working with?

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpatterns/html/ImpFrontControllerInASP.asp

# re: MVC and ASP.NET forms part II

Sunday, March 21, 2004 6:34 PM by Natty gur
thanks Matt for your comment.

Yes, I saw it. 1) poor implementation of command, can be improved. 2)using IHttahandler override default behaviour of pages.

thanks.

# re: MVC and ASP.NET forms part II

Monday, March 22, 2004 4:12 AM by Brian LeRoux
I look forward to seeing how you go about implementing this. Are you planning a workspace for the development? A good generic framework codebase would be super useful.

# re: MVC and ASP.NET forms part II

Monday, March 22, 2004 4:36 AM by Natty Gur
Regretfully I'm living my work for the next 3 weeks (I'm going to travel USA and to the MVP summit) so I hope my colleagues will finish the work. As soon as we have a working version a NWAF project will be open under SourceForge :-)

# re: MVC and ASP.NET forms part II

Monday, April 05, 2004 11:25 PM by Alfredo Coviello
It looks very interesting, but from what I've looked so far, it's not possible to use the ASPX built-in mechanism for postbacks and page event processing, if the IHttpHandler is not the codebehind the .aspx. I hope you or someone else (or Microsoft) come up with a solution...


# re: MVC and ASP.NET forms part II

Tuesday, April 06, 2004 1:20 PM by Natty Gur
You absolutely right. I think I got a solution. Stay tuned on NWAF (http://sourceforge.net/projects/nwaf/) project for documentation and alpha version soon as MVP summit ends.

# re: MVC and ASP.NET forms part II

Thursday, May 06, 2004 11:02 AM by Fernando Aramburu
Hi everybody

I'm a university student at the UNLP in Argentina and as a final work to get my degree I will make an MVC Framework for ASP.NET that will support Postback.
Next week I guess, I will start a sourceforge.net project to put my code and my releases to everybody.

There is already some code written and soon I hope we will have a beta release.

Fernando Aramburu
aramfer@sol.info.unlp.edu.ar

# re: MVC and ASP.NET forms part II

Tuesday, May 22, 2007 9:22 AM by pav

Hi All,

Please check this out.  ASP MVC framework!

http://www.troika-asp.com

Probably the first "proper" MVC framework for ASP 3.0!

It uses OO JavaScript for Model and Controller logic and XSLT transformation templates for the View.

Pav.

Leave a Comment

(required) 
(required) 
(optional)
(required)