No route in the route table matches the supplied values
I have three files one is called 'TwitterController.cs', the second one is called 'Latest Tweets.cshtml' and the third is called 'Home.cshtml'. When I load the page, I get the Error 'No route in the route table matches the supplied values'. Moreover, if I build the program in Visual Studio - it reports 'no errors', but the program still cannot load.
I know this is a very common problem, but I cannot find a solution to help me solve this issue.
TwitterController.cs
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Mvc;
using Umbraco.Web.Mvc;
namespace HighlyDeveloped.Core.Controllers
{
public class TwitterController : SurfaceController
{
public ActionResult GetTweets(string twitterHandle)
{
string PARTIAL_VIEW_FOLDER = "~/Views/Partials/";
return PartialView(PARTIAL_VIEW_FOLDER + "Latest Tweets.cshtml", twitterHandle);
}
}
}
I have amended my code (please see below), but I am still getting the same Error. I have added [ChildActionOnly] to the TwitterController.cs file, and updated the Home.cshtml file.
TwitterController.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Mvc;
using Umbraco.Web.Mvc;
namespace HighlyDeveloped.Core.Controllers
{
public class TwitterController : SurfaceController
{
[ChildActionOnly]
public ActionResult GetTweets(string twitterHandle)
{
string PARTIAL_VIEW_FOLDER = "~/Views/Partials/";
return PartialView(PARTIAL_VIEW_FOLDER + "Latest Tweets.cshtml", twitterHandle);
}
}
}
No route in the route table matches the supplied values
I have three files one is called 'TwitterController.cs', the second one is called 'Latest Tweets.cshtml' and the third is called 'Home.cshtml'. When I load the page, I get the Error 'No route in the route table matches the supplied values'. Moreover, if I build the program in Visual Studio - it reports 'no errors', but the program still cannot load.
I know this is a very common problem, but I cannot find a solution to help me solve this issue.
TwitterController.cs
Latest Tweets.cshtml
Home.cshtml
Could you try Html.RenderAction instead of Action? And you may want to mark the GetTweets function with the [ChildActionOnly] attribute.
I have amended my code (please see below), but I am still getting the same Error. I have added [ChildActionOnly] to the TwitterController.cs file, and updated the Home.cshtml file.
TwitterController.cs
Home.cshtml
is working on a reply...