zezo fareed

zezo fareed

  • NA
  • 6
  • 0

problem with img tag when using routing ASP.NET 4 Web forms

Jun 21 2011 6:44 AM
Hi 4 all ,

I'm using ASP.NET 4 Web forms routing like this :

RegisterRoutes(System.Web.Routing.RouteCollection route)
{
 route.MapPageRoute("Entries", "Details/{EntryId}", "~/Details.aspx");
}
void
but when the page Details.aspx/5 display all <img > tag not appear and the img src change to be like this


http://localhost:1561/Education/Details/images/LeftColmn_01.gif
but the original path is
http://localhost:1561/Education/images/LeftColmn_01.gif


i'm tring to add this to my global but not working


void RegisterRoutes(System.Web.Routing.RouteCollection route)
{


System.Web.Routing.RouteTable.Routes.RouteExistingFiles = false;

route.Add(new System.Web.Routing.Route(@"*\.png", new System.Web.Routing.StopRoutingHandler()));

route.Ignore("{*allpng}", new { allpng = @".*\.png(/.*)?" });

}

nothing get work ...
any help please.

Answers (2)