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 8021979
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T22:08:21+00:00 2026-06-04T22:08:21+00:00

I have a list of records, for each record I have an edit button

  • 0

I have a list of records, for each record I have an edit button to display the data and modify the information. When I clicked the save button the data is not saved in the database. What is the problem with my code, any help please? Here is my code for editing record

[HttpPost,ValidateInput(false)]
       public ActionResult EditEventDetails(int id, FormCollection collection)
       {
           var eventsdetails = _service.GeteventByID(id);
           UpdateModel(eventsdetails, "tbl_SBAem_Event");
           _eventRepository.SaveChanges();
           return RedirectToAction("Index");
       }
  • 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. Editorial Team
    Editorial Team
    2026-06-04T22:08:23+00:00Added an answer on June 4, 2026 at 10:08 pm

    It’s not entirely clear what your code is meant to do, but you never use the collection parameter, which presumably includes the data you want to update. You should presumably be applying that to your model before saving the changes.

    What does your current UpdateModel method do? You’re only giving it the information you’ve just fetched from the repository. I’d expect it to take the FormCollection in its signature, e.g.

    UpdateModel(eventsdetails, collection, "tbl_SBAem_Event");
    

    … but I’m really just guessing, as we don’t have much context. Whether that’s the right place or not, it certainly looks like ignoring the incoming data is likely to be the cause.

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

Sidebar

Related Questions

I have list of structure. I want to modify a particular data from the
So, I have a customer table, containing customer records, record, each of which has
Below, I have a grid of project records. I'm loading the project record list
I have a drop-down list of US states in my db. Each record has
I have a list: Collection users which has around 100K+ records of users (all
I have the script shown below that displays a list of records from a
I have a list of record Id's that I want to retrieve from Sql
I have a comma delimited list of record id's: string = 2207,117,90,2168,120,118,113,112,17 I need
I have a record store which holds a list of shopping items i am
I have a SharePoint external list that points to a 100,000 record SQL table.

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.