Having URL without .aspx extension

后端 未结 5 905
梦毁少年i
梦毁少年i 2020-12-30 10:37

I noticed a lot of ASP .Net sites does not have the URL ending with \".aspx\".

An example would be: - https://stackoverflow.com/questions

Did they create a Q

相关标签:
5条回答
  • 2020-12-30 10:56

    ASP.net has a routing framework you can use even if you are not using ASP.net MVC

    Official documentation: http://msdn.microsoft.com/en-us/library/cc668201.aspx

    Also as previously stated ASP.net MVC works like this out of the box and you can also use URL Rewriting

    0 讨论(0)
  • 2020-12-30 11:01

    StackOverflow is written using ASP.NET MVC. The MVC framework does not use .aspx files.

    The way it works internally is by using routing tables - see an overview here.

    You can also do this with ASP.NET and .aspx files or you can use URL rewriting. You can read about the differences here.

    0 讨论(0)
  • 2020-12-30 11:12

    You can use Url Rewriter to remove extensions from the urls of your website.

    0 讨论(0)
  • 2020-12-30 11:15

    With ASP.NET 4.0, you get the benefits of URL routing (nice, clean URLs) with ASP.NET webforms, too — see:

    • Routing for Web Forms in ASP.NET 4.0
    • URL Routing with ASP.NET 4 Web Forms (VS 2010 and .NET 4.0 Series)

    Basically, what you do is define a route like

    /question/{id}  or  /question/{title}
    

    and you then define what ASPX page this is being routed to. Quite nifty!

    0 讨论(0)
  • 2020-12-30 11:17

    You can refer to any URL rewriter or a routing technique for that. If you look at the new AS{.NET MVC, it works on that model only.

    0 讨论(0)
提交回复
热议问题