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


When I apply it on a page that does not have any QueryStrings , it is working fine.

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

  var elAdd = "& lt; li class =" + id_setClass + "& gt; & lt; img src =" + photo_src + " /> Gt; & lt; / li & gt ;, "; . ("# Ul_itemlist") $ enclosed (elAdd);   

Global.asax

  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); }   

Things I have not worked for

  routes.Ignore ("{* allpng}", new {allpng = @ ". .png (/.*)? "}); way. Add (new route (@ ". * \ .png", new standout handling handler ());    

I think the following should be done:

 < Code> route Unknown route ("{* png}", new {png = @ "(. * /). * *. Png (/.*)?"});   

There should be any way out of a .png (in any directory - the point you forgot the IMO)

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -