Solved

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

Posted on 2013-05-29
1
1,668 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

777 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