If you don’t want your site hackable, you should encrypt the hidden value. If you want to display the value also, use a styled span or read only input.
.Net 5 and Web MVC page question
Hello Experts
I am all new to this and real stumbled with an issue that I am not even sure would be achievable or not
I have a Web page designed with what is mentioned in the title, it is only one page that shows a few input boxes to fill in, I need to set the value of one of those boxes and lock it so the user cannot change it, let's assume the url for this page is
https://aaa.azurewebsites.net/Registration/Create
My idea is to pass the value of that input box in the url as the {id?], so the url will become something like
https://aaa.azurewebsites.net/Registration/Create?myvalue
So how can I set the input box value to myvalue in the url and then lock it so the user cannot change
Is that possible? and if so how can I do that please. this is really important for covid-19 testing which is currently spreading widely in NSW Australia and I need to track the test registrations via that input box
Cheers
2 answers
Sort by: Most helpful
-
-
AgaveJoe 26,141 Reputation points
2021-09-22T20:06:57.08+00:00 The URL you've shared is incorrect. Querystring parameters are located after the "?" and consist of a name and a value.
https://crsweb.azurewebsites.net?id=1
MVC has the concept of a route parameter where the parameter is part of the URL which matches a pattern. The default pattern is an id at the end of the URL.
https://crsweb.azurewebsites.net/controller/action/1
Your best option is to go through a beginning level tutorial which covers these fundamentals.