views:

51

answers:

1

I have a controller insert action:

<AcceptVerbs(HttpVerbs.Post)> _
Function InsertObject(<Bind(Exclude:="Id")> <ModelBinder(GetType(CustomModelBinder))> ByVal object As SomeObject) As ActionResult

End Function

And i have a CustomModelBinder class with a BindModel implementation:

Public Function BindModel( _
ByVal controllerContext As System.Web.Mvc.ControllerContext, _ 
ByVal bindingContext As System.Web.Mvc.ModelBindingContext) As Object Implements System.Web.Mvc.IModelBinder.BindModel
    For Each s In HttpContext.Current.Request.Form.Keys
        HttpContext.Current.Response.Write(s & ": " & HttpContext.Current.Request.Form(s) & "<br />")
    Next

    HttpContext.Current.Response.End()
End Function

As you can see I have a controllerContext and a ModelBindingContext available.

How do I get the: <Bind(Exclude:="Id")> part inside the BindModel implementation?

A: 

I reimplemented the issue. Question became obsolete.

Ropstah