简体   繁体   中英

how to display extension .aspx in asp.net?

in my web page, aspx extension will display at the time of loading and get removed after loading completes. I need the extension to be fixed and displayed forever. how can I fix this?

aspx extension is not displaying because of the default code generated by asp.net in App_Start\\RouteConfig.cs

 public static class RouteConfig
    {
        public static void RegisterRoutes(RouteCollection routes)
        {
            var settings = new FriendlyUrlSettings();
            settings.AutoRedirectMode = RedirectMode.Permanent;
            routes.EnableFriendlyUrls(settings);
        }
    }

If you comment out the above codes in RegisterRoutes method, friendly URL option will be removed and URL will be showing as such. In this case aspx.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM