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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T08:32:46+00:00 2026-05-24T08:32:46+00:00

Basically a button functionality the changes the data in a record in a database.

  • 0

Basically a button functionality the changes the data in a record in a database.

Pseudo:

If record in DB = 1, on button click, change to 2
Else if record in DB = 2, on button click, change to 1

Thank in advance for any tips/help

  • 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-05-24T08:32:47+00:00Added an answer on May 24, 2026 at 8:32 am

    Sudo controller action.

    public ActionResult DetailsChanged(DetailsRepository detailsRepository, Details detailsModel)
    {
      if(!ModelState.Valid)
    {
       ViewData["Error"] = "Error";
       return View();
    }
    
    Details newDetails = detailsRepository.FirstOrDefault(x => x.ID == detailsModel.Id);
    if(newDetails != null)
    {
       if(newDetails.Id == 1)
       {
          newDetails.Id = 2;
       } else {
          newDetails.Id = 2;
       }
       detailsRepository.SaveChanges();
       return View();
     }
    }
    

    Something like that.

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

Sidebar

Related Questions

Basically a button's tag property is the name of an existing combobox which I
I'm trying to enable functionality in my web app to allow users to click
So I basically dragged a button from interface builder's library, turned it into a
i got a client side javascript function which is triggered on a button click
I have a web application, in which browser's back button functionality should be customized.
I have a for loop setting the background images on buttons, basically the buttons
Basically, what I want to do is put some buttons before the tabs in
Basically what I want to do it this: a pdb file contains a location
Basically, something better than this: <input type=file name=myfile size=50> First of all, the browse
Basically I have some code to check a specific directory to see if an

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.