2 Replies - 629 Views - Last Post: 06 September 2017 - 11:38 AM Rate Topic: -----

#1 November-06  Icon User is offline

  • D.I.C Regular

Reputation: 53
  • View blog
  • Posts: 482
  • Joined: 04-January 11

MVC Structure in a VS Website

Posted 05 September 2017 - 10:00 PM

Hi guys, I am new to MVC and I'm working on an Umbraco project. This doesn't have a project file so when I opened it in Visual Studio, I chose "Open Website".

As this is a website, there is no namespace and classes are placed in App_Code. This causes me to be unable to call the classes under the Models folder which is outside the App_Code folder. Should I place the Models folder inside App_Code for my classes to be accessible?

Is This A Good Question/Topic? 0
  • +

Replies To: MVC Structure in a VS Website

#2 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 13493
  • View blog
  • Posts: 53,901
  • Joined: 12-June 08

Re: MVC Structure in a VS Website

Posted 06 September 2017 - 06:33 AM

Have you thought about making a MVC project in VS and adding the files to it that way?
Was This Post Helpful? 0
  • +
  • -

#3 November-06  Icon User is offline

  • D.I.C Regular

Reputation: 53
  • View blog
  • Posts: 482
  • Joined: 04-January 11

Re: MVC Structure in a VS Website

Posted 06 September 2017 - 11:38 AM

Well, instead of recreating the project, I think it's better to use the existing to avoid problems in missing files. Besides, Umbraco produces many folders and files along with it's installation so I think it's better to avoid recreating it.

For now, I'm placing it in App_Code but I am encountering problems in Umbraco calling the Model as it is getting a RenderModel type while it's expecting the Moel I created.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1