-3

A project kind of landed on my hands and I am having issues with one thing.

I have an already working project that is installed on a local server. I am able to make changes to existing pages, but I just tried creating a new page from copying an existing page and modifying it, but I keep getting an error when I try to open it. This is the error:

HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.

From my research so far, it looks like there has to be a controller in place to properly map the new pages, but I have not been able to find that within the project. I copied the project and opened it with ms visual on a different machine, same issue, everything opens and works just fine except the new page that I added. While the project is open on ms visual I do not see a folder for controllers either.

I would greatly appreciated if someone can point me on the right direction

Thank you,

Cesar R

Cesar
  • 1
  • You have the source code for the project? Not the files that are on the server (which is the compiled result). – mason Aug 15 '17 at 15:16
  • Can you post what the URL looks like? Sounds like you added the View, but not the corresponding controller action. – Grizzly Aug 15 '17 at 15:24
  • You need to add your methods in comtroller and then need to build it.. Controller cannot be copied directly – Power Star Aug 15 '17 at 16:05
  • Sorry, I do not have the source code it was not giving to me, I think from what I was told it was not available anymore. The project as I have it does not have the controller folders, nor any C# code on it that I can find. – Cesar Aug 15 '17 at 16:36
  • sorry no URL, the project is on a local machine. – Cesar Aug 15 '17 at 16:51
  • Now I was the source code, I am able to add the new view, everything seems correct, but now I am running into other issues. OK, I have the project running on a different machine with ms visual when I run it, I am able to see the website with the new views, but for some reason some of the videos on the pages wont load. That is one issue. Also when I try to publish the site to my wwwroot folder for my local host. I am able to see the website but all the formatting is done. I'll post some screen shots later today once I get to that machine. Any ideas? – Cesar Aug 16 '17 at 14:24

1 Answers1

0

With Model/View/Controller, you need a Controller to match with the View.

Let's say you add a new folder and cshtml to your file in the following folder:

~/Views/Test/Test.cshtml

You also need a controller named similarly in the following folder:

~/Controllers/TestController.cs

and inside that controller you need a method that matches the name of the view:

public ActionResult Test()
{
    return View();
}

That will make http://[yourwebsiteurl]/Test/Test be an active page.

Scott Dellinger
  • 158
  • 1
  • 12
  • Got it, I was on the right track, unfortunately with the project files as I have them, I do not have any code, nor any controller folders or files. I will probably have to request them to see if they are available. – Cesar Aug 15 '17 at 16:42
  • OK, looks like I am going to get the source code. I'll post more info once I have it. – Cesar Aug 15 '17 at 18:53