Hiding the URL of a page on an ASP.NET website

I built a simple ASP.NET website that has a menu with all the page URLs associated with each menu item. when I click on a menu item, the URL of the page is displayed in the address bar, for example, "http: //mywebsite/xyz/webform1.aspx". I would like to hide this page URL and instead show only the website URL, for example "http: // mywebsite" for all pages. Please let me know how this can be achieved. thanks in advance. if it is too difficult to achieve, is it possible to show a fake URL instead of the actual URL for each page? I do not want to show the actual page name in the url.

+3
source share
7 answers

I found a solution at this link using the URL Routing method, which is new in ASP.NET 3.5 SP1. I am using ASP.NET 3.5 and IIS6. my main goal was to hide the actual URL of the page (I should have clearly indicated this in my question), which can be achieved by showing friendly URLs using this technique. This article helps. Thanks to all of you for your quick answers and suggesting other ways to achieve this.

http://www.4guysfromrolla.com/articles/051309-1.aspx

+2
source

- , "Cloaking URL", , iframe , URL- .

( MVC, ), , , "URL" . , .

Redirect/RedirecToAction, , RedirectLocation .

, , . , URL-, . , @Slaks, .

+3

iframe, , index.html www.mysite.com, index.html iframe, -, , , "www.mysite.com"

+1

, ... -

OnclientClick, Javascript:

    <asp:LinkButton ID="myButton" OnClientClick="go();" runat="server" Text ="Go somewhere"/>

Next add a javascript function to go where you want to redirect:

    <script type="text/javascript">
        function go() {
            window.location = "http://www.google.com/";
        }
    </script>

URL- - javascript- , , ! , ... ...

+1

, , " -" " -" ( ). JavaScript: URI, XHR.

0

Try using Server.Transfer, create a single page that acts as a gateway and passes the URL. This should be fairly easy to implement.

0
source

you can use the Rewriting URL to hide the url address through web.config and the Global.asmx file in the Application_BeginRequest event and get the URL and rewrite it to the Application HttpApplication = sender as HttpApplication

app.Context.RewritePath (path, true);

0
source

Source: https://habr.com/ru/post/1774328/


All Articles