You can't use the Lambda-based MVC helpers with shapes. There are non-Lambda-based overloads that you can use instead. Not as type-safe, but shapes are not type-safe (kind of the point actually).
From: Jeroen Bakker [mailto:[email protected]] Sent: Sunday, June 26, 2011 2:30 AM To: [email protected] Subject: driver and widget instead of module Hello, I have build a module first for a specific form in Orchard. the model doesn't store anything, it just calculates a value from 4 form input fields: public class Leenbedrag { [Required] [DisplayName("Netto Maandinkomen")] public double TotaalInkomen { get; set; } .... then i use in the home view : @{Html.BeginForm("Bereken", "", FormMethod.Post, new { id = "leenbedrag" }); } and: @(Html.TextBoxFor(m => m.TotaalInkomen, new {@class = "display" })) Then I decided that I needed a widget, just to make it possible to show the form anywhere in the site The Leenbedrag class is used in the shape... protected override DriverResult Display( MaxlenenWidgetPart part, string displayType, dynamic shapeHelper) { return ContentShape("Parts_MaxlenenWidget", () => shapeHelper.Parts_MaxlenenWidget( Startbedrag: part.Startbedrag ?? 25000, leenbedrag : new Leenbedrag())); } How to use the leenbedrag now in my View Part? @(Html.TextBoxFor(m => m.TotaalInkomen, new {@class = "display" })) should be something like: @(Html.TextBoxFor(m => m.leenbedrag.TotaalInkomen, new {@class = "display" })) ?? Met vriendelijke groet, Jeroen Bakker Fibonacci [email protected]<mailto:[email protected]> http://www.fibonacci.nl 0229-544446 06-55176260 --- You are currently subscribed to orchard-discuss as: [email protected]<mailto:[email protected]>. To unsubscribe send a blank email to [email protected]<mailto:[email protected]>. --- You are currently subscribed to orchard-discuss as: [email protected]. To unsubscribe send a blank email to [email protected].
