如何在ASP.NET MVC中隐藏浏览器中的操作和控制器名称 [英] How to hide action and controller name in browser in ASP.NET MVC

查看:285
本文介绍了如何在ASP.NET MVC中隐藏浏览器中的操作和控制器名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想隐藏行动&来自asp.net mvc浏览器的控制器名称。

请帮帮我。

例如。 www.mysite.com/account/login

www.mysite.com/home/address

这是我的浏览器地址。

但是我希望两个页面都可以只使用www.mysite.com进行访问。



我尝试了什么:



我已经尽了最大努力,但我成功隐藏了控制器名称,但我想隐藏它们。

所有页面都可以使用相同的URL访问。

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.

推荐答案

引用:

但我希望这两个页面都只能使用www.mysite.com进行访问。

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





就像其他成员建议的那样,你不能。当你只使用一个网址时,你怎么能够确定要加载哪个页面?



你可能想尝试研究<$ c $的概念c> iframe ,并在那里加载您不希望在浏览器中公开实际网址的页面。话虽如此,您仍然需要提供实际的URL作为 iframe 的来源。



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.


这篇关于如何在ASP.NET MVC中隐藏浏览器中的操作和控制器名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆