How to change date before updater.TryUpdateModel(part, Prefix, null, null);

Topics: Writing modules
Sep 28, 2012 at 10:46 AM
Edited Sep 28, 2012 at 10:48 AM

 

 protected override DriverResult Editor(GalleryPart part, IUpdateModel updater, dynamic shapeHelper)
        {
            updater.TryUpdateModel(part, Prefix, null, null);

            return Editor(part, shapeHelper);
        }

 

How can i change part data?

 

 protected override DriverResult Editor(GalleryPart part, IUpdateModel updater, dynamic shapeHelper)
        {
            part.Dir = "abc";
            updater.TryUpdateModel(part, Prefix, null, null);

            return Editor(part, shapeHelper);
        }

part.Dir = "abc"; - not work. Updater get values from post...

Developer
Sep 28, 2012 at 8:17 PM

I don't understand. If you want to override a value that's set by the model binder, why don't you do it after TryUpdateModel()?