asp.net - Page loading twice -
i'm working on asp.net 4.0 webforms site , i'm trying out routing. thought worked fine until discovered 1 of pages loaded twice when using routing.
i got in global.asax.cs
:
private void application_start(object sender, eventargs e) { registerroute(routetable.routes); } void registerroute(routecollection routes) { routes.mappageroute("noregion", "{language}/region", "~/region.aspx"); routes.mappageroute("region", "{region}/{language}/region", "~/region.aspx"); }
why region.aspx
loaded twice when using either route?
edit: well, had application_error setup redirect default page (region) when there 404. happened site couldn't find favicon.ico redirected page hence double loading. removed , retried it, did not work! i'm pulling hairs here.
edit 2: adding favicon.ico 'fixed' it.
edit 3: web.config had customerrors enabled: <error statuscode="404" redirect="eng/region?" />
. removing fixed more!
i did asp.net 4 empty app. , emulated cases 2 calls:
- http://{server}/seg0/seg1/region - matches - {region}/{language}/region
- http://{server}/seg0/region - {language}/region
fiddler shows me single call both cases(not taking account call resourses) works fine. sure haven't missed other details?
Comments
Post a Comment