0

We have a Silverlight 4 Component that gets loaded with content from a folder called "ClientBin" by referring to absolute Physical paths on the Server like the following:

C:\SomethingWebApplication\ClientBin\Uploads\carimage.jpg

We want The Routing Engine to ignore paths like the one mentioned above.

I tried the following:

   routes.IgnoreRoute(......fill in the blank.......);

Please answer to the fill in the blank above that would ensure ASP.NET MVC ignores hard coded physical images in the folder called "ClientBin"

crazyTech
  • 1,379
  • 3
  • 32
  • 67

1 Answers1

1

routes.IgnoreRoute("Ignore/"); where Ignore is the name of your folder.

Mike Beeler
  • 4,081
  • 2
  • 29
  • 44
  • Sorry it failed to work. Do you have any other suggestions? :) – crazyTech Dec 03 '13 at 21:11
  • It is an absolute physical path C:\\VisualStudioProjects\\PerlsPivot\\PivotServer\\ClientBin\\ApplicationIcon\\linkIcon.png that gets loaded in a Silverlight application – crazyTech Dec 03 '13 at 21:30
  • the case I was thinking of was more root of the web site/directory which works. I just retested it. By definition files that are not part of the web site cannot be accessed. so what is the test case that an application or user could access an absolute path outside your web application? – Mike Beeler Dec 03 '13 at 21:46
  • The absolute physical path C:\\VisualStudioProjects\\PerlsPivot\\PivotServer\\ClientBin\\ApplicationIcon\\linkIco‌​n.png is part of my application that is tested on IIS Express that is installed on my local development computer. Therefore, it is part of my application. The C:\\VisualStudioProjects\\PerlsPivot\\PivotServer\\ClientBin\\ApplicationIcon\\linkIco‌​n.png is accessed by the Silverlight component that is part of the ASP.NET application. – crazyTech Dec 03 '13 at 22:07
  • so from your web site how do you access that directory? is the root of the web project perlsPivot or PivotServer? – Mike Beeler Dec 03 '13 at 22:09
  • The root of the Web Application is PivotServer – crazyTech Dec 03 '13 at 22:10
  • so you would like to exclude PivotServer/ClientBin... but it should still be accessable to Silverlight? – Mike Beeler Dec 03 '13 at 22:18
  • It needs to be accessible to the Silverlight component. However, I don't see why we have to mention PivotServer application folder. PivotServer is the main ASP.NET Web Application. Shouldn't we disregard PivotServer since it is the ASP.NET application itself? – crazyTech Dec 03 '13 at 22:28
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/42441/discussion-between-user1338998-and-mike-beeler) – crazyTech Dec 03 '13 at 22:54
  • Mike, Thanks for your help. I figured out the problem. Please look at my answer. – crazyTech Dec 04 '13 at 01:33