不在浏览器网址中显示网页名称 [英] not display page name in browser url
本文介绍了不在浏览器网址中显示网页名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
i我在我的应用程序中使用url重写。我希望当用户在浏览器中输入url时
即htttp://www.abc.com或www .abc.com它将分别显示网址,即https://www.abc.com或www.abc.com。但是在我的应用程序中它会显示url,即www.abc.com/user/index.aspx。它在url.please中显示实际路径,帮助我解决问题。下面是我在global.asax页面中的代码
Hi Everyone,
i am using url rewriting in my application.i want when user enter url in browser
i.e. htttp://www.abc.com or www.abc.com it will display the url i.e htttp://www.abc.com or www.abc.com respectively. but in my application it display the url i.e www.abc.com/user/index.aspx . it display the actual path in url.please help me to solvemy problem. below is my code in global.asax page
void Application_Start(object sender, EventArgs e)
{
// Code that runs on application startup
RegisterRoutes(RouteTable.Routes);
}
public static void RegisterRoutes(RouteCollection routeCollection)
{
routeCollection.MapPageRoute("RouteForMainCategory", "{Category}", "~/User/index.aspx");
routeCollection.MapPageRoute("RouteForSubCategory", "{Category}/{SubCategory}", "~/User/index.aspx");
routeCollection.MapPageRoute("RouteForMainPage", "{ }", "~/User/index.aspx");
}
推荐答案
这样做......它有效。
do like this...it works.
routeCollection.MapPageRoute("RouteForIndex", "Default", "~/Default.aspx");
这篇关于不在浏览器网址中显示网页名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文