1

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 :)

quetzalcoatl
  • 32,194
  • 8
  • 68
  • 107
Pushpendra
  • 820
  • 7
  • 11
  • If you are writing HTML in C#, I would recommend either using TagBuilder or a library like HtmlTags. https://github.com/DarthFubuMVC/htmltags You gain a lot of advantages of composability if you do it right and you never have to worry about forgetting to close a tag. – Ryan Apr 02 '11 at 08:20
  • But the question remains, is there a UNITY way to make my web UI composite ? – Pushpendra Apr 04 '11 at 10:04

1 Answers1

0

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

Pushpendra
  • 820
  • 7
  • 11