ASP.NET MVC2 - specific fields in form pass via a specific object?

Posted by ile on Stack Overflow See other posts from Stack Overflow or by ile
Published on 2010-04-30T11:06:19Z Indexed on 2010/04/30 11:57 UTC
Read the original article Hit count: 253

Filed under:
|
|
|

In database I have Contacts table:

ContactID (int)
FirstName (varchar)
LastName (varchar)
...
XmlFields (xml) // This field is xml type

To create a new contact, I created two classes - one for regular fields and other to display fields from XmlFields field.

In Controller, I have following:

public ActionResult Create(Contact contact, FormCollection collection)
...

Regular field I catch with contact object and those that need to be stored as xml in XmlFields I try to catch with collection object. Problem is that collection object catches all fields, so I wonder if it is possible to isolate xml fields when posting to a specific object so that I can easily manipulate with them. I need this in separated objects because these xml fields are going to be generated dynamically and will be different for every user.

Thanks in advance,
Ile

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about mvc2