1

Given the following two routes:

        routes.MapRoute(name: "NationalRssResults", url: "{searchTerm}/rss", defaults: new { controller = "Results", action = "SearchWholeCountryRss" });
        routes.MapRoute(name: "CityRssResults", url: "{city}-{state}/{searchTerm}/rss", defaults: new { controller = "Results", action = "SearchCityStateRss" });

Navigating to localhost:51860/fire-blanket/rss returns data just fine, however trying localhost:51860/SomeState-SomeCity/fire-blanket/rss returns in an Illegal characters in path error.

These routes are at the top of my list so no others should interfere, right?

I have traced this all the way through the RSS content generation and always begins with:

<?xml version="1.0" encoding="utf-16"?><rss xmlns:a10="http://www.w3.org/2005/Atom" version="2.0"><channel><title>...

The view looks like this:

@model MyApp.Models4.ResultsPage

@Html.Raw(Model.rssResults)

I have already tried a few of the web.config suggestions here - still no go.

I'm not sure why I'm getting this error. Assistance appreciated.

Thanks.

Community
  • 1
  • 1
ElHaix
  • 12,846
  • 27
  • 115
  • 203
  • I believe that you are getting the error because of the - between city and state. Is that really necessary? Why not do: "{city}/{state}/{searchTerm}/rss"? – drneel Nov 19 '13 at 21:21

0 Answers0