Search code examples
asp.net-mvcunity-containerioc-containerunity2.0

Injecting UI in ASP.NET- MVC using UNITY 2.0


I am using UNITY 2.0 with MVC 3.

I have injected types using the container into MVC.net solution. All this while the types were non-UI component.How can I inject a type which has UI ?

The solution i can think of is to write UI rendering Code somethign like following and wrap it with a C# Type.

class HTMLHelper    
{   
    string spitTable()   
    {    
        string strUITable = "<Table><TR><TD><TD></TR></Table>";      
        return strUITable ;   
    }   
}

Is it correct way of doing thing ? Any one having better solution ?

Iam using ASP.NET MVC and still prefer to use the shtml files :)


Solution

  • I think i got my answer , it's WCSF(web client software factory). also look for 'Composite web UI application block'.

    http://webclientguidance.codeplex.com/

    also look into

    http://blogs.msdn.com/b/blaine/archive/2010/03/22/will-wcsf-vs-2010-version-support-unity-2-0-and-asp-net-mvc.aspx