In my global.asax.cs file. I add an entry
routes.MapRoute(
"Static text",
"Static/General/{filePath}",
new { controller = "Static", Action = "General", filePath = "" },
// new { filePath = @"xxxx" } // greedy regular expression
);
What I want to do is to take the content from the static files and insert into my view pages. This map works fine if my filePath is in the root such as 1.txt. But it won't work if the file is located in some sub directory such as staticfiles/1.txt. Because the routing module will consider "staticfiles" as the filePath and leave the "1.txt" as some other parameter. I know what I need to do is applying some regular expression trick on the filePath parameter. But I couldn't figure out how to make the regex engine to read all the way to end of url. Can someone show me the trick I should apply? Thanks very much.