Solved

ASP.Net MVC 4 C# -- pass HIDDEN url string ?

Posted on 2013-05-29
1
1,733 Views
Last Modified: 2013-06-02
How can I pass the below as a HIDDEN value so users cannot change URL string ?
      @Html.ActionLink("Create New", "Create", new { default_value = "5555" })

  ** Current = http://localhost:49450/POdetail/Create?default_value=5555
  ** Desired = http://localhost:49450/POdetail/Create?somethingUsersCannotEasilyChange
-------------------------------------------------------------------------------------------------------------
CONTROLLER below

        public ActionResult Create(string default_value)
        {
            ViewBag.PO_ID = new SelectList(db.POheaders, "ID", "Supplier");

            POdetail myEntity = new POdetail();
            myEntity.PartDescription = default_value;
            return View(myEntity);
        }
0
Comment
Question by:finance_teacher
1 Comment
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
ID: 39204605
You're talking about something on the client's machine. How do expect to change something you have no control over?

If you want to hide data from the user, then use a POST method for your form. Be aware:  This is not a security measure. Anyone with basic HTTP knowledge can circumvent this method. I think you may want to reconsider your design.
0

Featured Post

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
LINQ Select all records by MAX data syntax help 1 27
Reactjs with .NET 3 70
how to reference the id of my checkbox in a dynamic GridView control 2 29
Selenium and Xpath 4 28
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question