using Umbraco.Web.Mvc;
using System.Web.Mvc;
namespace PyramidWebsite.Controllers
{
public class FileDownloadSurfaceController : SurfaceController
{
public const string PARTIAL_VIEW_FOLDER = "~/Views/Partials/FileDownload/";
public ActionResult RenderFileDonwload()
{
return PartialView(PARTIAL_VIEW_FOLDER + "_FileDownload.cshtml");
}
}
}
Model (FileInfo):
namespace PyramidWebsite.Models
{
public class FileInfo
{
public int FileId { get; set; }
public string FileName { get; set; }
public string FilePath { get; set; }
}
}
Model (FileDownload):
using System.Collections.Generic;
using System.IO;
namespace PyramidWebsite.Models
{
public class FileDonwloads
{
public List<FileInfo> GetFile()
{
List<FileInfo> listFiles = new List<FileInfo>();
string fileSavePath = System.Web.Hosting.HostingEnvironment.MapPath("~/Media");
DirectoryInfo dirInfo = new DirectoryInfo(fileSavePath);
int i = 0;
foreach (var item in dirInfo.GetFiles())
{
listFiles.Add(new FileInfo()
{
FileId = i + 1,
FileName = item.Name,
FilePath = dirInfo.FullName + @"\" + item.Name
});
i = i + 1;
}
return listFiles;
}
}
}
No route in the route table matches the supplied values
Hi,
I'm trying to render a partial view within a template. But I keep getting a "No route in the route table matches the supplied values."?
Surface controller (FileDonwloadSurfaceController):
Model (FileInfo):
Model (FileDownload):
The partial view:
Inside the template I'm doing:
Best regards /David
I am not sure if that is your problem but you have a big typo in your code:
FileDonwloadSurface = FileDownloadSurface
OMG
is working on a reply...