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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:22:56+00:00 2026-05-28T05:22:56+00:00

I am working on a Asp.Net MVC 3/knockout.js site for several users where they

  • 0

I am working on a Asp.Net MVC 3/knockout.js site for several users where they can save information about their websites
Here is a simple version of the model

class{
string Id
string Name
string Url
string Description
}

I want to build a very responsive UI so all loading saving etc will be done through Ajax.

So the scenario is when a user has added som websites to his list and clicks save a json string is posted to an Actionmethod in a controller.

Everything works fine.

Problem is:

How can i ensure the user has not tampered with the id and is actually saving information about some other users website?

Id is of course hiddden, but any evil person with some web knowledge can easily change the id.

  • 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-28T05:22:56+00:00Added an answer on May 28, 2026 at 5:22 am

    You should use authentication. Decorate the action that will perform the update with the Authorize attribute. This will ensure that the user that is sending the AJAX request is authenticated, and he cannot change his username. Then you will check in your database if the id of the site he is trying to update belongs to him. You will of course have a table that will contain the mapping between users and sites.

    If the user tampers the site id and puts some value of a site that doesn’t belong to him, you in the controller action will detect it when you perform the query to verify if a given site id belongs to a given username. He cannot tamper his username as it is stored in an encrypted authentication cookie, unless of course he signs in with a different username in which case he already knows the password.

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

Sidebar

Related Questions

After working with ASP.Net MVC, it has me thinking about Rails. I worked with
While working on ASP.NET MVC 2 web site I faced to the following problem.
I'm working on asp.net mvc web site Localization and I've faced problems with enums
I'm working with ASP.NET MVC 4. When we build a project, they add an
I'm working with ASP.Net MVC and I would like to make a web site
I am working in ASP.NET Web Application. I dont know about MVC and ASP.NET
I don't have grid view as I am working on asp.net MVC. So can
I'm currently working with ASP.NET and about to start learning ASP.NET MVC (2). So
I've been working with asp.net MVC and am still not very good at it.
So I am working with ASP.Net MVC + jQuery autocomplete and I have a

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.