Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Apr 19, 2012 05:45 AM by minhpg
Member
19 Points
98 Posts
Apr 04, 2012 02:46 AM|LINK
i'm using web form routing in my site, RegisterRoutes functions as below:
void RegisterRoutes(RouteCollection routes) { //routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.Add(new Route("{resource}.axd/{*pathInfo}", new StopRoutingHandler())); routes.Add(new Route("{Images}.jpg/{*pathInfo}", new StopRoutingHandler())); routes.MapPageRoute("services-show", "Service/{Name}", "~/Service.aspx"); routes.MapPageRoute("intros-show", "Intro/{Name}", "~/About.aspx"); routes.MapPageRoute("faqs-showthread", "FAQ/Question/{Name}", "~/ShowFAQ.aspx"); }
i use themes in my web app as well, i put all image, .swf in App_Themes\mythemes\Images. When i run my web app in root url like that
http://myweb/ all image and .swf flash file display correctly, but when i run http://myweb/FAQ/Question/xyz
it can not display images and .swf flash file until i make new directory like FAQ\Question\Images in my root web and copy all images and .swf flash file from App_Themes\mythemes\Images into FAQ\Question\Images directory.
How can i fix this problem?
All-Star
16006 Points
1728 Posts
Microsoft
Apr 11, 2012 01:54 AM|LINK
Try this: routes.MapPageRoute("faqs-showthread", "{FAQ}/{Question}/{Name}", "~/ShowFAQ.aspx");
Apr 19, 2012 05:45 AM|LINK
thank you for your reply. i move all image link into theme (css) and use ResolveURL function to resolve resource url. Now it work for me.
minhpg
Member
19 Points
98 Posts
Webform routing?
Apr 04, 2012 02:46 AM|LINK
i'm using web form routing in my site, RegisterRoutes functions as below:
void RegisterRoutes(RouteCollection routes)
{
//routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.Add(new Route("{resource}.axd/{*pathInfo}", new StopRoutingHandler()));
routes.Add(new Route("{Images}.jpg/{*pathInfo}", new StopRoutingHandler()));
routes.MapPageRoute("services-show", "Service/{Name}", "~/Service.aspx");
routes.MapPageRoute("intros-show", "Intro/{Name}", "~/About.aspx");
routes.MapPageRoute("faqs-showthread", "FAQ/Question/{Name}", "~/ShowFAQ.aspx");
}
i use themes in my web app as well, i put all image, .swf in App_Themes\mythemes\Images. When i run my web app in root url like that
http://myweb/ all image and .swf flash file display correctly, but when i run http://myweb/FAQ/Question/xyz
it can not display images and .swf flash file until i make new directory like FAQ\Question\Images in my root web and copy all images and .swf flash file from App_Themes\mythemes\Images into FAQ\Question\Images directory.
How can i fix this problem?
Frank Jiang ...
All-Star
16006 Points
1728 Posts
Microsoft
Re: Webform routing?
Apr 11, 2012 01:54 AM|LINK
Try this: routes.MapPageRoute("faqs-showthread", "{FAQ}/{Question}/{Name}", "~/ShowFAQ.aspx");
Feedback to us
Develop and promote your apps in Windows Store
minhpg
Member
19 Points
98 Posts
Re: Webform routing?
Apr 19, 2012 05:45 AM|LINK
thank you for your reply. i move all image link into theme (css) and use ResolveURL function to resolve resource url. Now it work for me.