Skip to main content
2 of 4
deleted 15 characters in body; edited tags
JNYRanger
  • 203
  • 2
  • 8

Partial Model Updates From View

I hope this is on-topic here since I'm a bit new to the whiteboard...

I'm currently developing an application using ASP.NET MVC 5 (and WebAPI 2). One of my domain entities is huge, and is stored in a document database (MongoDb in this case). I'm currently brainstorming the best way to handle the updating of this entity. I'm currently using a 1:1 model of this entity.

The View currently is split up into sections of this large model where a user can click on a section and then the section then appears as a form for the end-user to update those fields (properties of the model). This is where I'm not sure if I'm doing this properly: The current implementation is sending the ENTIRE model to a WebAPI controller via $.ajax() to update the database with these changes, and if successful I update the View on the client side to display the current values.

I feel like I'm not really leveraging the ASP.NET MVC framework here though except for the initial display of the view, since I'm performing these updates on the client side.

Is this the proper way to do partial updates of a model (at least using ASP.NET MVC 5)? I don't really want to have to refresh the entire page by requesting a new view after submission using the server-side processing of forms. Should each of these sections be a partial view along with smaller models that can then update the larger entity? In this case I believe that I can then utilize the server-side processing for forms since it can then send a new partial view? (Am I even understanding how to use partial views here?!)

I'm a bit confused if you couldn't tell...

JNYRanger
  • 203
  • 2
  • 8