Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 680189
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T01:20:39+00:00 2026-05-14T01:20:39+00:00

I am embarking upon my first ASP.NET MVC project and I would like to

  • 0

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.

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:

Name          Age       Position      Date Joined
Jon Smith     23        Striker       18th Mar 2005
John Doe      38        Defender      3rd Jan 1988

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.

My main question is what architecture / tools would be best suited to this fulfil my requirements at a high level?

From the research I have done so far my initial conclusions were:

  1. ADO.NET 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.

  2. Partial Views to create a template and then iterate through a
    datatable that I have pulled back
    from my database model.

  3. jQuery to allow the user to edit data in the table, error check
    edited data entries etc.

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). Any thoughts on this?

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. Again, is there reason to reconsider this view?

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. Am I right to consider Html.RenderAction or have I misunderstood its usage?

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.

Thanks

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T01:20:39+00:00Added an answer on May 14, 2026 at 1:20 am

    Data Access – ADO.NET is great if you are used to it. I have had great results using Subsonic ActiveRecord and PetaPoco. Once installed, it moves the whole data access busywork out of the way without any substantial learning investment, unlike many of the other ORMs. They are free to use and I definitely recommend them.

    Tables – Partial views might be useful if you had very complex interaction of several sets of data that you were combining after retrieval in your business classes. However, if you are presenting data that comes from one table, or even is close to it’s final form as a query result, there is no reason to use them for that. Instead, iterate over data with a foreach loop and format the HTML that way.

    Grid-like presentation is pretty easy this way.

    <% foreach (var row in Model.Rows) {%>
        [HTML for one row]
    <%}%>
    

    This could even be done with HTML tables, since you presenting tables of data.

    <table>
    <% foreach (var row in Model.Rows) {%>
        <tr>
            <td>row.Element1</td>
            <td>row.Element2</td>
            <td>row.Element3</td>
        </tr>
    <%}%>
    </table>
    

    Grid Appearance – As far as appearance, such as striping or coloring your data based on content, make those decisions part of the model data you send over and simply use CSS classes in your View to achieve that. For example, you could return the value “odd” or “even” in the OddEven field, which would be CSS classes that you could style in your stylesheet.

    <table>
    <% foreach (var row in Model.Rows) {%>
        <tr class=<%=row.OddEven%>>
            <td>row.Element1</td>
            <td>row.Element2</td>
            <td>row.Element3</td>
        </tr>
    <%}%>
    </table>
    

    Sorting – As far as getting into heavy jQuery or javascript for sorting and manipulating the data, I would wait until I had some known performance issue before worrying about reloading data all of the time. However, if you reload data every time, you might find issues with the data in the grid constantly being refreshed and your user finding that they lose the position of the cursor or get interrupted while editing or that the changes trigger events on incomplete edits that end up in the database.

    Although it seems like if a grid of data is in date order, and someone changes the date, the most important thing is to resort the data immediately. I don’t claim to know your situation, but after years of doing this, I have found that just letting the user get their work done (perhaps by skipping the resorting, for example) is often more important the rearranging rows, which often means the data the were trying to edit has jumped elsewhere and they have to find it again.

    A compelling interface could be that save are sent behind the scenes as the data elements are changed, but the grid does not reposition or resort. Of course, next time the page is refreshed, it would be resorted, but not during the editing session. Just an idea for consideration.

    Client Interaction – If your app has many users and lots of edits, large datasets can lead to a lot of traffic if you refresh data on every edit. However, if this is an in-house app with limited users or limited activity, that is certainly not a concern. Using jQuery for editing data works pretty well – you can add calls to save data as it is edited and that can give the app the usability that has been lacking in more traditional web apps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I'm embarking on an ASP.NET MVC project and while the experience has been
I am embarking upon my first journey of test driven development in C#. To
I am embarking upon a NLP project for sentiment analysis. I have successfully installed
I'm embarking on a GUI Activity composed of a viewflipper, which I would like
We are embarking on our first Silverlight project, coming from WPF. It's a relatively
We will be embarking on an Application developement project (.NET 3.5) for a large
We're embarking on a project for a client. They plan on having about 50k
I'm embarking on a major project, but am stuck on a tiny issue at
I am embarking on some learning and I want to write my own syntax
I'm toying with the idea of embarking on a cloud-based client/server spare-time project using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.