Saturday, March 26, 2011

FuBuMVC - WebForms

FubuMVC is a plugable framework when User interface comes into play. It can be easily switched from WebForm view-engines to Spark. Other view-engines will be supported in near future.

However, By default WebForm view-engine is available in all samples and there is one convention that is applied for all WebForm pages. For example, if you have a page called HomePage.aspx and your page is inherited from a class called HomePage.

<%@ Page Language="C#" Inherits="MyProject.UI.Actions.Home.HomePage" %>
then HomePage class should be inherited from FubuPage and implements like that :

    public class HomePage : FubuPage
    {
    }

Where "HomeViewModel" is the exact object returned from HomeAction's Execute method ( last post). That means after an action is executed, the returned object is hanged to its own page by convention. By this approach, developers don't need to worry about their code-behind class(such as what we have in WebForm) and of course, if they go to other view-engines. Because, all business codes are in Execute Method.

 

No comments:

Post a Comment