Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public ActionResult UpdateWidgetColor( [Bind(Include="Color,ID")]Widget widget )
- {
- }
- public ActionResult UpdateWidgetColor( int id, string color )
- {
- var whitelist = new string[] { "Color" };
- Widget widget = db.Widgets.SingleOrDefault( w => w.ID == id );
- if (widget == null) ...handle missing widget error
- if (!TryUpdateModel( widget, whitelist ))
- {
- ...
- }
- else
- {
- }
- }
Add Comment
Please, Sign In to add comment