Click here to Skip to main content
15,886,963 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am passing some parameters in a controller action method through a Hyperlink.
I need to hide the parameters in the address bar and show only the Action method name.
For e.g. http://localhost/Controller/MethodName

Can anyone tell me how this can be achieved?

What I have tried:

I have used query string to pass the data, but that has to be avoided. I tried to assign the data to a hidden variable and pass the model. Even then the data is coming in the address bar.
Posted
Updated 17-Aug-16 0:49am

1 solution

You can only hide the parameters if you do a POST rather than a GET. To do this your hyperlink will need to execute javascript that submits a form to your action rather than being a normal hyperlink.

Things you shouldn't spend time doing | The ASP.NET Forums[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900