views:

329

answers:

1

I am using the ASP.NET MVC VB.NET XML Literals View Engine created by Dmitry Robsman and described on his blog in this post.

http://blogs.msdn.com/dmitryr/archive/2008/12/29/asp-net-mvc-view-engine-using-vb-net-xml-literals.aspx

I would like to create strongly typed view pages using this view engine, but it doesn't seem to contain the requisite VbView(Of TModel) generic type by which I would create such a view class.

The end result should look something like this:

Namespace Views.Client
    Public Class Details(Of Models.Client)
        Inherits SiteMaster

        Public Overrides Function RenderContent() As XElement
            Return _
            <fieldset>
                <legend>Fields</legend>
                <p>
                    FirstName:
                    <%= Xhtml.Encode(Model.FirstName) %>
                </p>
                <p>
                    MiddleName:
                    <%= Xhtml.Encode(Model.MiddleName) %>
                </p>
                <p>
                    LastName:
                    <%= Xhtml.Encode(Model.LastName) %>
                </p>
            <fieldset>
        End Function

    End Class
End Namespace

Once there is a VbView(Of TModel) class that inherits from Dmitry's VbView class, I will need help figuring out how to hook that up so that it works with standard MVC controllers that call the view like this.

Function Details(ByVal id As Integer) As ActionResult
    Dim c = SomeGetClientFunction(id)
    Return View(c)
End Function
A: 

I downloaded the ASP.NET MVC C# source code and was able to figure out how to create the VbView(Of TModel) class by mirroring some of that structure. I have created a project on CodePlex that contains that new class and a couple other changes that enhance what Dmitry did. http://vbmvc.codeplex.com

Dennis Palmer