MVC 4 Controller Compilation Error trying to return a Model
Posted
by
Joe
on Stack Overflow
See other posts from Stack Overflow
or by Joe
Published on 2013-10-18T15:39:43Z
Indexed on
2013/10/18
15:54 UTC
Read the original article
Hit count: 138
This is a newbie configuration problem I suspect.
See return statement comment in code snippet.
[HttpGet]
public ActionResult TestService()
{
ViewBag.Message = "DataLayer Service";
Service dataLayerService = new Service {CookieContainer = new CookieContainer()};
dataLayerService.SetSessionAppName("SAND");
WebServiceModel webServiceModel = new WebServiceModel();
webServiceModel.Result = dataLayerService.GetSessionAppName();
return this.View(webServiceModel); // <== Cannot resolve View "TestService"
}
© Stack Overflow or respective owner