C# asp.net中的url路由和重写

C# asp.net中的url路由和重写,c#,asp.net,C#,Asp.net,我在url路由中面临一些问题 实际上,我已经在我的web应用程序中完成了url重写和url路由,每个想法都很好,但我面临的一个问题是 public class Global : System.Web.HttpApplication { void Application_Start(object sender, EventArgs e) { RegisterRoutes(RouteTable.Routes);

我在url路由中面临一些问题

实际上,我已经在我的web应用程序中完成了url重写和url路由,每个想法都很好,但我面临的一个问题是

  public class Global : System.Web.HttpApplication
    {        
        void Application_Start(object sender, EventArgs e)
        {
            RegisterRoutes(RouteTable.Routes);
        }

        static void RegisterRoutes(RouteCollection routes)
        {
            routes.MapPageRoute("admin", "admin", "~/adminpanel.aspx");
            routes.MapPageRoute("companyPanel", "company", "~/companyPanel.aspx");
            routes.MapPageRoute("default", "default", "~/default.aspx");
            routes.MapPageRoute("CustomerDetails", "Details/{*propertyid}", "~/AdDetails.aspx",false);
            routes.MapPageRoute("NewRecord", "NewRecord", "~/AdProperty.aspx");
            routes.MapPageRoute("PropertyRecords", "PropertyRecords", "~/agentsAds.aspx");

        }


        protected void Session_Start(object sender, EventArgs e)
        {

        }

        protected void Application_BeginRequest(object sender, EventArgs e)
        {

        }

        protected void Application_AuthenticateRequest(object sender, EventArgs e)
        {

        }

        protected void Application_Error(object sender, EventArgs e)
        {

        }

        protected void Session_End(object sender, EventArgs e)
        {

        }

        protected void Application_End(object sender, EventArgs e)
        {

        }
    }
`
在上面的语法中,当我打开公司页面时,它工作正常,url看起来像“localhost:10852/company”,当我转到详细信息页面时,我也在url中传递值,像“localhost:10852/Details/33” 当我再次进入公司页面时,url看起来像“localhost:10852/Details/company”,但它应该像“localhost:10852/company”。。。
它只从url中删除了propertyid,但上一页仍然存在于url中。请告诉我如何删除上一页的“详细信息”名称。请帮助我

如果有人知道解决方案,请帮助我……您是否使用锚定标记从公司导航到详细信息,反之亦然,如果是,请共享HTML。仅仅显示RegisterRoutes方法不足以了解您的实际问题。此页面将把值传递给详细页面,当我再次想在另一个页面上移动时,问题就发生了……它从url中只移动参数,而不删除上一个页面的页面名实际上是“details/{proeprtyid}”在这种语法中,属性id是我传递给url中另一个页面的值,但当我转到详细页面并尝试返回任何其他页面时,只有“propertyid”是reomove,并且“details”没有从url中删除,我想同时删除“details/{proeprtyid}”例如,我想回到公司页面,url看起来像“localhost/10852/detail/company”,但应该像“localhost/10852/company”。谢谢