views:

31

answers:

0

Is it possible to customize the object initiation / providing with the default ASP.NET MVC Modelbinder?

<AcceptVerbs(HttpVerbs.Post)> _
Function EditObject(id As int, <Bind(Exclude:="Id")> obj As BLL.Object) As ActionResult

End Function

I would like to 'provide' obj to the modelbinder. (i don't want the Modelbinder to use New() and instantiate obj, but I want to deliver the object from a custom repository.) Is this possible?

Edit: The loading from the repository should be done based on the id parameter of EditObject...