Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • kyle 49 posts 240 karma points
    Feb 11, 2022 @ 10:53
    kyle
    0

    I cant see my view pages in visual studio?

    Hey there,

    I built all my HTML code pages within the Umbraco CMS(doctypes with templates) which leaves me with the following issue, I cant see my views within the project solution in visual studio? There is nothing there? Or am I just being silly? please help me.

    The reason I want to see the .cshtml files within VS is that I want to access the .cs file(code behind) of one of the views, I am required to write certain functionality in .net.

    Please assist me...

  • Brendan Rice 538 posts 1101 karma points
    Feb 11, 2022 @ 13:06
    Brendan Rice
    1

    The csproj file references all the files that can be seen within the solution. If the file hasn't been added using Visual Studio it will be there but will be hidden (as it hasn't been added to the csproj file).

    You can view hidden files by clicking the button below at the top of solution explorer:

    enter image description here

    You can then right click the greyed out (hidden) file and include in solution.

  • kyle 49 posts 240 karma points
    Feb 11, 2022 @ 14:02
    kyle
    0

    Hi

    thank you so much for helping out so quickly! I came right, just a last question, so how would I access the .cs file of the .cshtml file if you understand what I'm saying? I want to view the code behind my views?

  • Corné Hoskam 80 posts 587 karma points MVP 3x c-trib
    Feb 11, 2022 @ 14:59
    Corné Hoskam
    101

    Hi Kyle,

    Umbraco 8 makes use of the MVC structure, meaning that there is no 'code behind' of your .cshtml file like in the old versions of WebForms. There are two things you could be referring to:

    Hope this helped!

    Kind regards,

    Corné

  • kyle 49 posts 240 karma points
    Feb 12, 2022 @ 10:33
    kyle
    0

    Hi Corné!

    Thanks a million brother, I think i will just add my own controller files within VS in stead of using umbraco models builder. Because I have to build certain functionality with C# and not js, I will try that out but I’m sure it will work. Thanks again

  • Anderson Cox Cox 3 posts 73 karma points
    Feb 12, 2022 @ 09:21
    Anderson Cox Cox
    0

    I came right, just a last question, so how would I access the .cs file of the .cshtml file if you understand what I'm saying.

    official website

Please Sign in or register to post replies

Write your reply to:

Draft