Reputation: 3
I want to render mvc view file from a remote location like suppose test.cshtml
file will be stored in s3 bucket and it is public accessable. I already tried like bellow but it says error-
The view 'https://s3.amazonaws.com/testtt123/test.cshtml' or its master was not found or no view engine supports the searched locations.
public ActionResult Index()
{
//return View("~/Views/Home/test.cshtml"); // this works fine
return View("https://s3.amazonaws.com/testtt123/test.cshtml"); // this not works
}
Whtats the easy way to do it? I dont want to use any 3rd party library. How can i do it with mvc5? Thanks in advance
Upvotes: 0
Views: 37
Reputation: 1810
This scenario is not supported by ASP.NET MVC. The view file must be stored on the local file system. A network location may work too, but will slow you down. But there is no way the framework will pull a view over an HTTP connection.
Upvotes: 3