DocumentServer/OnlineEditorsExample/OnlineEditorsExampleMVC/Controllers/HomeController.cs

34 lines
899 B
C#
Raw Normal View History

2015-04-29 16:10:50 +00:00
using System.Web.Mvc;
using OnlineEditorsExampleMVC.Helpers;
using OnlineEditorsExampleMVC.Models;
namespace OnlineEditorsExampleMVC.Controllers
{
public class HomeController : Controller
{
public ActionResult Index()
{
return View();
}
public ActionResult Editor(string fileName, string mode)
{
mode = mode ?? string.Empty;
var file = new FileModel
{
TypeDesktop = mode != "embedded",
FileName = fileName
};
return View("Editor", file);
}
public ActionResult Sample(string fileExt)
{
var fileName = DocManagerHelper.CreateDemo(fileExt);
Response.Redirect(Url.Action("Editor", "Home", new { fileName = fileName }));
return null;
}
}
}