Solved

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

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

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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

760 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now