如何从C#中删除Url中的扩展名。像“.Aspx”一样 [英] How Do I Remove Extensions From Url In C#. Like ".Aspx"

查看:152
本文介绍了如何从C#中删除Url中的扩展名。像“.Aspx”一样的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何从c#中删除页面网址的扩展名。像.aspx



例如http://www.codeproject.com/Questions/ask.aspx



i希望我的网络应用程序的网址格式如下..

http://www.codeproject.com/Questions/ask



如果有任何人有想法,那么请求指导我...

how do i remove extensions from page url in c#. like .aspx

e.g http://www.codeproject.com/Questions/ask.aspx

i want the url of my web application in following format..
http://www.codeproject.com/Questions/ask

if any one have a idea then pleas guide me...

推荐答案

你在谷歌搜索过这里之后才发布这个吗?

有在互联网上可以找到几篇好文章。



我的推荐是Scott Hanselman的以下博客文章

使用IIS重写模块将ASP.NET旧版URL重定向到无扩展名 [ ^ ]



希望,它有帮助:)
Have you searched this in Google before posting here?
There are several good articles available for this in the internet.

My recommendation is the following blog post by Scott Hanselman
Redirecting ASP.NET Legacy URLs to Extensionless with the IIS Rewrite Module[^]

Hope, it helps :)


Hello Sud hir,

ARe你知道HTTPHandler或UrlRewritting的概念。如果不合适请参考简单的例子。

简单示例

Anotheir示例

这个例子解释了你的概念



我也面对过这种情况早些时候。



希望它能帮助你

快乐编码
Hello Sudhir ,
ARe You aware of the concept HTTPHandler or UrlRewritting.If Not Kindly Refer the simple example.
Simple Example
Anotheir Example
This Example explains you the concept

I have also Faced this situation some times earlier.

Hope It Helps you
Happy Coding


这篇关于如何从C#中删除Url中的扩展名。像“.Aspx”一样的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆