0

I am currently working on building a web role in a Azure cloud services. What I want to do is to call the one ActionResult method in HomeController in the run() method in webrole.cs class.

What I did is that I create a new instance of HomeController and call the action directly like this:

HomeController homeController = new HomeController();
homeController.changeView();

The changeView method is like this which basically redirect me to another view in another controller.

public ActionResult changeView()
{ 
    return RedirectToAction("EnvInfoView", "Ingestion");
}

When I run in the debug mode, the return return RedirectToAction("EnvInfoView", "Ingestion"); statement is reached and run, however the view does not change at all.

What should I do, any help is appreciated! Thanks in advance.

de li
  • 882
  • 1
  • 13
  • 25
  • Why did you post the same question twice? http://stackoverflow.com/questions/31478753/how-to-change-the-view-in-mvc-in-webrole-cs – Adam Jul 17 '15 at 15:31
  • I am sorry for the confusion, here what I'm trying to ask is how to change the view in webrole.cs while in the other post, I am wondering how can I pass variables assigned in the webrole.cs to the controller of the MVC application. – de li Jul 17 '15 at 15:44

0 Answers0