Solved

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

Posted on 2013-05-29
1
1,783 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Why You Need a DevOps Toolchain

IT needs to deliver services with more agility and velocity. IT must roll out application features and innovations faster to keep up with customer demands, which is where a DevOps toolchain steps in. View the infographic to see why you need a DevOps toolchain.

Question has a verified solution.

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

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
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.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

751 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