删除文件扩展名 [英] Removal of file Extension
本文介绍了删除文件扩展名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要删除我托管的网页的扩展名。给我一个替代解决方案。
ex:Home.aspx as Home
I need to remove the extension name of my page where i have hosted. give me an alternate solutions.
ex: Home.aspx as Home
推荐答案
您需要创建或修改Global.asax到包括以下代码。
You will need to create or modify your Global.asax to include the following code.
void Application_BeginRequest(object sender, EventArgs e)
{
string fullUrl = Request.Url.ToString();
if (fullUrl.Contains("/products/suiting.aspx"))
{
Context.RewritePath("/products.aspx?category=suiting");
}
else if (fullUrl.Contains("/products/jackets.aspx"))
{
Context.RewritePath("/products.aspx?category=jackets");
}
}
嗨Ammu,
你可以做通过重写网址
试试这个链接 [ ^ ]和这一个 [ ^ ]。
希望这对你有所帮助。
问候,
RK
Hi Ammu,
You can do it by rewriting the url
Try this link [^]and this one [^].
Hope this helps you a bit.
Regards,
RK
这篇关于删除文件扩展名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文