Note that there are some explanatory texts on larger screens.

plurals
  1. POAdvice on displaying and allowing editing of data using ASP.NET MVC?
    primarykey
    data
    text
    <p>I am embarking upon my first ASP.NET MVC project and I would like to get some input on possible ways to display database data and general best practice.</p> <p>In short, the body of my webpage will show data from my database in a table like format, with each table row showing similar data. For example:</p> <pre><code>Name Age Position Date Joined Jon Smith 23 Striker 18th Mar 2005 John Doe 38 Defender 3rd Jan 1988 </code></pre> <p>In terms of functionality, primarily I’d like to give the user the ability to edit the data and, after the edit, commit the edit to the database and refresh the view.The reason I want to refresh the view is because the data is date ordered and I will need to re-sort if the user edits a date field.</p> <p><strong>My main question is what architecture / tools would be best suited to this fulfil my requirements at a high level?</strong></p> <p>From the research I have done so far my initial conclusions were:</p> <ol> <li><p><strong>ADO.NET</strong> for data retrieval. This is something I have used before and feel comfortable with. I like the look of LINQ to SQL but don’t want to make the learning curve any steeper for my first outing into MVC land just yet.</p></li> <li><p><strong>Partial Views</strong> to create a template and then iterate through a datatable that I have pulled back from my database model.</p></li> <li><p><strong>jQuery</strong> to allow the user to edit data in the table, error check edited data entries etc.</p></li> </ol> <p>Also, my initial view was that caching the data would not be a key requirement here. The only field a user will be able to update is the field and, if they do, I will need to commit that data to the database immediately and then refresh the view (as the data is date sorted). <strong>Any thoughts on this?</strong></p> <p>Alternatively, I have seen some jQuery plug-ins that emulate a datagrid and provide associated functionality. My first thoughts are that I do not need all the functionality that comes with these plug-ins (e.g. Zebra striping, ability to sort by column using sort glyph in column headers etc .) and I don’t really see any benefit to this over and above the solution I have outlined above. <strong>Again, is there reason to reconsider this view?</strong></p> <p>Finally, when a user edits a date, I will need to refresh the view. In order to do this I had been reading about Html.RenderAction and this seemed like it may be a better option than using Partial Views as I can incorporate application logic into the action method. <strong>Am I right to consider Html.RenderAction or have I misunderstood its usage?</strong></p> <p>Hope this post is clear and not too long. I did consider separate posts for each topic (e.g. Partial View vs. Html.RenderAction, when to use jQuery datagrid plug-in) but it feels like these issues are so intertwined that they need to be dealt with in context of each other.</p> <p>Thanks</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload