Click here to Skip to main content
15,868,141 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
I want to use URL rewriting in my latest online shopping website. Here i am setting it in Global.asax. It is working properly . But the current pages are loading many times. Each image files,css files,script files everything is comming as urls, thats why it is taking a long time to load. How to avoid this.

this is my Global.asax
C#
void RegisterUrl(RouteCollection route)
       {
           
           route.MapPageRoute("Home", "Home", "~/Default.aspx");

           route.MapPageRoute("About", "AboutUs/{d}", "~/About.aspx");

           route.MapPageRoute("Product1", "{Dept}", "~/Product.aspx");

           route.MapPageRoute("Product2", "ProductView/{C}", "~/Product.aspx");

           route.MapPageRoute("Product3", "{Dept}/{Cat}", "~/Product.aspx");

           route.MapPageRoute("Product4", "{Dept}/{Cat}/{SC}", "~/Product.aspx");
          
       }

       void Application_Start(object sender, EventArgs e)
       {
           RegisterUrl(RouteTable.Routes);
           // Code that runs on application startup

       }
Posted
Comments
Kornfeld Eliyahu Peter 21-Oct-14 10:05am    
Why do you think it is because of URL re-writing?
Did you tested it without?
Member 9492907 22-Oct-14 0:59am    
hi peter, i tested it without URL rewriting, the master page is loading only once (ie,it is going to the break point only once. But in url rewriting the break point is hitting multiple times) and because of this loading time is too much.At the time if we check the current url , it is showing all the image url and scripts urls

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900