Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Created January 6, 2016 17:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bjoerntx/002a477df5a5814155f5 to your computer and use it in GitHub Desktop.
Save bjoerntx/002a477df5a5814155f5 to your computer and use it in GitHub Desktop.
public ActionResult GetView(string viewName)
{
switch (viewName)
{
case "Open":
var documents = new List<Document>();
foreach (string file in Directory.GetFiles(
Server.MapPath("/App_Data/documents")))
{
Document doc = new Document(file);
documents.Add(doc);
}
return PartialView("Stageviews/Open", documents);
}
return PartialView("Stageviews/" + viewName);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment