Ikram Shams

Ikram Shams

  • NA
  • 82
  • 0

Error in global.asax in url routing

Jul 1 2012 12:23 PM
i am using global.asax for url rewriting. it is runing fine offline but when i upload it online it gives me error given below. 
Cannot use a leading .. to exit above the top directory.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.Web.HttpException: Cannot use a leading .. to exit above the top directory.

Source Error: 

.......................
My globa coding is given below.
System.Web.Routing.RouteTable.Routes.MapPageRoute("Home", "HomePage", "~/DefaultEn.aspx");
System.Web.Routing.RouteTable.Routes.MapPageRoute("Login", "User Login", "~/Login.aspx");
System.Web.Routing.RouteTable.Routes.MapPageRoute("Registration", "User Registeration", "~/Registration.aspx");
System.Web.Routing.RouteTable.Routes.MapPageRoute("ProductPage", "Products", "~/Products.aspx");
System.Web.Routing.RouteTable.Routes.MapPageRoute("Product","Products/{name}", "~/ProductsCategory.aspx");
System.Web.Routing.RouteTable.Routes.MapPageRoute("ColorPage", "Colors", "~/Colors.aspx");
System.Web.Routing.RouteTable.Routes.MapPageRoute("Showroom", "Find Showroom", "~/FindShowroom.aspx");
System.Web.Routing.RouteTable.Routes.MapPageRoute("Academy", "Our Academy", "~/Our_Academy.aspx");
System.Web.Routing.RouteTable.Routes.MapPageRoute("AboutUs","About Us","~/AboutUs.aspx");
System.Web.Routing.RouteTable.Routes.MapPageRoute("ContactUs","Contact Us","~/ContactUs.aspx");
System.Web.Routing.RouteTable.Routes.MapPageRoute("Career","Careers","~/Careers.aspx");
System.Web.Routing.RouteTable.Routes.MapPageRoute("FAQ", "FAQs", "~/Faq.aspx");
System.Web.Routing.RouteTable.Routes.MapPageRoute("SiteMap", "Site Map", "~/SiteMap.aspx");
System.Web.Routing.RouteTable.Routes.MapPageRoute("Newspage", "News", "~/CNews.aspx");
System.Web.Routing.RouteTable.Routes.MapPageRoute("Calculator", "Paint Calculator", "~/PaintCalculator.aspx");
System.Web.Routing.RouteTable.Routes.MapPageRoute("BestViewed", "Best Viewed", "~/BestViewed.aspx");
System.Web.Routing.RouteTable.Routes.MapPageRoute("News", "Latest News/{NId}", "~/News.aspx");

//Sub Folder (2nd Level)
System.Web.Routing.RouteTable.Routes.MapPageRoute("HomePage", "../HomePage", "~/~/DefaultEn.aspx");
System.Web.Routing.RouteTable.Routes.MapPageRoute("Login2", "../User Login", "~/~/Login.aspx");
System.Web.Routing.RouteTable.Routes.MapPageRoute("Registration2", "../User Registeration", "~/~/Registration.aspx");
System.Web.Routing.RouteTable.Routes.MapPageRoute("ProductPage2", "../Products", "~/~/Products.aspx");
System.Web.Routing.RouteTable.Routes.MapPageRoute("ColorPage2", "../Colors", "~/~/Colors.aspx");
System.Web.Routing.RouteTable.Routes.MapPageRoute("Showroom2", "../Find Showroom", "~/~/FindShowroom.aspx");
System.Web.Routing.RouteTable.Routes.MapPageRoute("Academy2", "../Our Academy", "~/~/Our_Academy.aspx");
System.Web.Routing.RouteTable.Routes.MapPageRoute("AboutUs2", "../About Us", "~/~/AboutUs.aspx");
System.Web.Routing.RouteTable.Routes.MapPageRoute("ContactUs2", "../Contact Us", "~/~/ContactUs.aspx");
System.Web.Routing.RouteTable.Routes.MapPageRoute("Career2","../Careers", "~/~/Careers.aspx");
System.Web.Routing.RouteTable.Routes.MapPageRoute("FAQ2", "../FAQs", "~/~/Faq.aspx");
System.Web.Routing.RouteTable.Routes.MapPageRoute("SiteMap2", "../Site Map", "~/~/SiteMap.aspx");
System.Web.Routing.RouteTable.Routes.MapPageRoute("Newspage2", "../News", "~/~/CNews.aspx");
System.Web.Routing.RouteTable.Routes.MapPageRoute("BestViewed2", "../Best Viewed", "~/~/BestViewed.aspx");
System.Web.Routing.RouteTable.Routes.MapPageRoute("Calculator2", "../Paint Calculator", "~/~/PaintCalculator.aspx");
//System.Web.Routing.RouteTable.Routes.MapPageRoute("About Academy2", "../Our Academy/About Academy", "~/AcademyCategory.aspx");
//System.Web.Routing.RouteTable.Routes.MapPageRoute("Objectives2", "../Our Academy/Objectives", "~/AcadmyObjectives.aspx");
//System.Web.Routing.RouteTable.Routes.MapPageRoute("Training Courses2", "../Our Academy/Training Courses", "~/TrainingCourses.aspx");

System.Web.Routing.RouteTable.Routes.MapPageRoute("About Academy", "Our Academy/About Academy","~/AcademyCategory.aspx");
System.Web.Routing.RouteTable.Routes.MapPageRoute("Objectives", "Our Academy/Objectives", "~/AcadmyObjectives.aspx");
System.Web.Routing.RouteTable.Routes.MapPageRoute("Training Courses", "Our Academy/Training Courses","~/TrainingCourses.aspx");

System.Web.Routing.RouteTable.Routes.MapPageRoute("About Colors", "Colors/About Colors", "~/AboutColor.aspx");
System.Web.Routing.RouteTable.Routes.MapPageRoute("View Catalogues", "Colors/View Catalogues", "~/ViewCatalogues.aspx");
System.Web.Routing.RouteTable.Routes.MapPageRoute("Color Gallery", "Colors/Color Gallery", "~/ColorGallery.aspx");
System.Web.Routing.RouteTable.Routes.MapPageRoute("Colors 2012", "Colors/Colors 2012", "~/Color2012.aspx");
System.Web.Routing.RouteTable.Routes.MapPageRoute("Design Collection", "Colors/Design Collection", "~/DesignCollection.aspx");
System.Web.Routing.RouteTable.Routes.MapPageRoute("Colors Choice", "Colors/Colors Choice", "~/ColorsChoice.aspx");
System.Web.Routing.RouteTable.Routes.MapPageRoute("Color Library", "Colors/Color Library", "~/ColorLibrary.aspx");


//3rd Level
System.Web.Routing.RouteTable.Routes.MapPageRoute("Courses","Training Courses/{SubCatName}", "~/~/~/Courses.aspx");

where is the problem. Please suggest me