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

  • Home
  • SEARCH
  • 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 79663
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T21:10:52+00:00 2026-05-10T21:10:52+00:00

Given an ASP.NET MVC view that generates a table of entries using a for

  • 0

Given an ASP.NET MVC view that generates a table of entries using a ‘for’ loop, what is the best way to add a ‘delete’ link for each of the table rows? My first intuition would be to use jQuery to make an AJAX call to delete the row, then refresh the table. It seems like there should be an easier way though. Maybe make the link perform a post to a delete url (e.g. /Item/Delete/1) which would redirect back to the page displaying the items?

  • 1 1 Answer
  • 0 Views
  • 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. 2026-05-10T21:10:52+00:00Added an answer on May 10, 2026 at 9:10 pm

    both are acceptable ways, and actually exactly the same.

    In the first you are using AJAX to post to the URL and AJAX to refresh the table. In the second, you are not using AJAX.

    Either way, posting the id to be deleted to the delete ActionMethod (I’d use Destroy, but that’s personal preference) is the way to go.

    To make it even better do something like this …

    [AcceptVerbs(HttpVerbs.Delete)]     public ActionResult Detail (int id)     {         // Add action logic here      } 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The problem: Using ASp.NET MVC for reporting. Given: 1. A report that is tabular
Given that: The asset pipeline is fairly complex (coming from ASP.NET MVC, this is
I know that ASP.NET MVC will allow me to swap in various View engines
I have an ASP.NET MVC view that uses jquery.Uploadify to post files to one
ASP .NET MVC 1 I'd like to show a partial view base on a
I'm using ASP.NET MVC and I have a model class which represents a peice
I am using ASP.NET MVC 2 & .Net 3.5 with Visual Studio 2008. Ok,
One of the benefits of ASP.NET MVC I keep reading about is that it's
I am using ASP.NET-MVC and nHibernate for the first time. Great tools, but big
Working on an ASP.NET MVC 3 (Razor) application, that's mainly concerned with UGC (user

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.