UpdateModel prefix - ASP.NET MVC

Posted by Kristoffer Ahl on Stack Overflow See other posts from Stack Overflow or by Kristoffer Ahl
Published on 2008-12-07T12:27:05Z Indexed on 2010/05/21 21:10 UTC
Read the original article Hit count: 404

Filed under:

I'm having trouble with TryUpdateModel(). My form fields are named with a prefix but I am using - as my separator and not the default dot.

<input type="text" id="Record-Title" name="Record-Title" />

When I try to update the model it does not get updated. If i change the name attribute to Record.Title it works perfectly but that is not what I want to do.

bool success = TryUpdateModel(record, "Record");

Is it possible to use a custom separator?

© Stack Overflow or respective owner

Related posts about asp.net-mvc