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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T22:15:07+00:00 2026-05-13T22:15:07+00:00

In ASP.NET MVC (default routing),I’d like to use a URL like this to return

  • 0

In ASP.NET MVC (default routing),I’d like to use a URL like this to return a View with a form to edit a customer:

/Customers/Edit/5

I need to make use of CustomerId=5, but I don’t want to permit a customer to change it.Right now I make the id hidden using:

<%= Html.Hidden("CustomerId") %>

This accomplishes what I want,but I’m under the impression that hidden form variables are not secure and can be manipulated by the end user.

So, what’s the best way to allow a customer to edit their information but not their ID?

  • 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-13T22:15:07+00:00Added an answer on May 13, 2026 at 10:15 pm

    My solution was to use the Tamper Proofing code from Steven Sanderson’s ASP.NET MVC book. The idea is that you create a hash of any hidden form field you want to tamper proof:

    <%= Html.Hidden("CustomerId") %>
    <%= Html.Hidden("CustomerIdHash") %>
    

    When the form is submitted, Steven’s code then computes another hash of CustomerId and makes certain it equals CustomerIdHash. If it does, then no tampering has occurred. It’s great code, and worth the price of the book.

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

Sidebar

Related Questions

I've recently set up an ASP.net site (not using MVC.net) to use URL Routing
Following on from this question: ASP.NET MVC Routing with Default Controller I have a
I've a very basic ASP.NET MVC application that uses the default routing. Now I
by default the ASP.NET MVC engine searches the following folders for View pages: /Views/
I changed the default routing in ASP.NET MVC from routes.MapRoute( Default, // Route name
I am implementing a new ASP.NET MVC 3 application that will use a form
I want to set up a ASP.NET MVC route that looks like: routes.MapRoute( Default,
I have an ASP.NET MVC application with the default membership database. I am accessing
i have taken the default asp.net mvc template and customized to work for me.
In a standard ASP.NET MVC template application that is created by default in Visual

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.