Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I want to hide action & controller name from browser in asp.net mvc.
Please help me out.
Eg. www.mysite.com/account/login
www.mysite.com/home/address
This is my browser address.
But I want both pages can be access using www.mysite.com only.

What I have tried:

I have tried my best but I am success to hide controller name but I want to hide both.
all pages can be accessed using same URL.
Posted
Updated 13-Sep-16 3:55am
Comments
Peter_in_2780 7-Sep-16 1:43am    
That doesn't make sense. If you only have one URL, how do you know which page to serve?
Member 11498882 7-Sep-16 1:58am    
I know but there is requirement to hide action & controller name. There is no importance to know on which page I am working I want to hide action and controller name.
F-ES Sitecore 8-Sep-16 4:32am    
Then tell the person who gave you this requirement that it's impossible as that is not how the net works. It's like someone saying "I have a requirement to time travel". The answer isn't to find out how to build a time machine but to tell the person it simply isn't possible.

1 solution

Quote:
But I want both pages can be access using www.mysite.com only.


Just like what the other members suggested, you can't. How would you be able to determine which page to load when you are only using one url?

You may probably want to try looking into the concept of iframe, and load the page there that you don't want the actual url to be exposed in the browser. Having that said, you still need to provide the actual URL as the source to your iframe.
 
Share this answer
 
v2

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