c# - Using URL routing with querystring parameter cause error to load all .png/.jpg images In ASP.NET 4.0 -
I am trying to implement URL Routing on my web application
   But when I try to apply the same for a web page, the JScript runtime error by using query strings.                   & lt;% = ResolveClientUrl (" ~ / Raphl_map / raphael-min.js ")%> Type = "text / javascript" & gt; & Lt; / Script & gt; Now in my Ajax call, I generate dynamic tags with the urlpath related to dynamically and facing the problem for those dynamic images,     AJAX on success response  Adding Le element to the loop     Global.asax     Things I have not worked for      I think the following should be done:    There should be any way out of a 
 When I apply it on a page that does not have any  QueryStrings , it is working fine.   
 var elAdd = "& lt; li class =" + id_setClass + "& gt; & lt; img src =" + photo_src + " /> Gt; & lt; / li & gt ;, "; . ("# Ul_itemlist") $ enclosed (elAdd);    
 Empty register routes {// routes.gnore ("{file}." Png "); // way. Unknown route ("{file} .png"); // way. Unblock ("{* alljpg}", new {alljpg = @ ". * .. jpe? G"}); // way. Ignore ("{* allpng}", new {allpng = @ ". * \. Png (/.*)?"}); way. Add (new route (@ ". * \ .png", new standout handling handler ()); way. Route xxing files = false; Routes.MapPageRoute ("Home", "Home", "~ / homepage.aspx"); Routes.MapPageRoute ("Login", "Login", "~ / login.aspx"); Routes.MapPageRoute ("Profile", "Profile / {user_id}", "~ / MyProfile.aspx"); } Zero Application_Start (Object Sender, EventArgs E) {RegisterRoutes (RouteTable.Routes); }    
 routes.Ignore ("{* allpng}", new {allpng = @ ". .png (/.*)? "}); way. Add (new route (@ ". * \ .png", new standout handling handler ());     < Code> route Unknown route ("{* png}", new {png = @ "(. * /). * *. Png (/.*)?"});   
 
  
Comments
Post a Comment