Hide URL in browser address bar


I have an application in aspx and I use the bootstrap navbar to build the navigation menu, my question is how can I hide the url in the browser so that each time I change the page does not appear the route, I the menu is dynamically assembled from the BD, the code I have is the following:

<li class="dropdown">
    <a href="<%=dsMenuPadres.Tables["MenuPadres"].Rows[i]["PATH"].ToString() %>" class="dropdown-toggle" data-toggle="dropdown"  id="<%=dsMenuPadres.Tables["MenuPadres"].Rows[i]["NOMBRE"].ToString() %>" >
        <%= dsMenuPadres.Tables["MenuPadres"].Rows[i]["NOMBRE"].ToString() %> <b class="caret"></b>
    <% if (objControllerSeg.GetMenuHijos(dsMenuPadres.Tables["MenuPadres"].Rows[i]["ID_MODULO"].ToString(), int.Parse(Session["idRol"].ToString())))
          dsMenuHijos = objControllerSeg.DsReturn;
          if (dsMenuHijos.Tables["MenuHijos"].Rows.Count > 0) 
           <ul class="dropdown-menu">
                for (int j = 0; j < dsMenuHijos.Tables["MenuHijos"].Rows.Count; j++)
                     <li><a   href="<%=dominio+dsMenuHijos.Tables["MenuHijos"].Rows[j]["PATH"].ToString() %>" id="<%=dsMenuHijos.Tables["MenuHijos"].Rows[j]["ID_MODULO"].ToString() %>"><%= dsMenuHijos.Tables["MenuHijos"].Rows[j]["NOMBRE"].ToString() %></a></li>
             <% }%>
        <% } %>                                       

asked by Jose Felix 26.07.2016 в 03:40

1 answer


This you can not achieve, when you define a link when you press it the browser will navigate to it and show it in the address bar, this can not be avoided.

Now if you create an application that uses <frameset> this prevents the url changes when you navigate from one page to another, but it is not recommended at all if you are applying bootstrap, therefore it is discarded.

Another technique to apply some framework on the client side, such as Angular when creating a development SPA (Simple Page Application) This type of structure allows you to navigate between the different views without displaying the actual url of the template that they load, since they actually visualize it within ng-view

Single Page Apps with AngularJS Routing and Templating

answered by 26.07.2016 в 07:18