Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Is there an easy way into Razor, without necessarily adopting all of MVC to begin with?

Is there an easy way into Razor, without necessarily adopting all of MVC to begin with?

Scheduled Pinned Locked Moved Web Development
asp-netcsharpdatabasearchitecturequestion
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Patrick Skelton
    wrote on last edited by
    #1

    My question is a little vague and not simple but I will try to be as concise as possible. 1. I want to create a new website from scratch. 2. I am a professional developer but have limited web experience. 3. I have extensive C# experience and my small amount of web experience has been on ASP.NET WebForms. For this reason, I would like to stick with Microsoft technologies. 4. It is almost 100% likely I will be the only person working on the site. 5. Initially the site will be no more than 10-20 pages and can probably be static HTML/CSS. 6. Even if the site becomes successful, still it is unlikely to get any tougher than maybe being able to query a back-end database, maybe have a login facility, maybe host a blog, maybe a shopping cart. But even if all of this does one day happen, the visitor numbers are likely to be tens-per-day. I would like to move away from Web Forms because it seems to be too complex for my needs and because of this I find I never update the site. I was thinking of recreating the site initially as static HTML/CSS but I like the idea of being able to add small chunks of Razor code here and there, to keep my options open if I need to add something I can't do in HTML. So I was wondering if I can do this. Can I use Visual Studio to create a simple HTML/CSS web site that allows me to add bits of Razor code if needed? If I can do this, presumably I could later progress onto a more formal MVC architecture if I felt it was needed? And one final part to this question: should I be looking at vanilla Razor or would I be better looking into Blazor? Any help or advice would be very gratefully received. Kind wishes ~ Patrick

    Thank you to anyone taking the time to read my posts.

    Richard DeemingR 1 Reply Last reply
    0
    • P Patrick Skelton

      My question is a little vague and not simple but I will try to be as concise as possible. 1. I want to create a new website from scratch. 2. I am a professional developer but have limited web experience. 3. I have extensive C# experience and my small amount of web experience has been on ASP.NET WebForms. For this reason, I would like to stick with Microsoft technologies. 4. It is almost 100% likely I will be the only person working on the site. 5. Initially the site will be no more than 10-20 pages and can probably be static HTML/CSS. 6. Even if the site becomes successful, still it is unlikely to get any tougher than maybe being able to query a back-end database, maybe have a login facility, maybe host a blog, maybe a shopping cart. But even if all of this does one day happen, the visitor numbers are likely to be tens-per-day. I would like to move away from Web Forms because it seems to be too complex for my needs and because of this I find I never update the site. I was thinking of recreating the site initially as static HTML/CSS but I like the idea of being able to add small chunks of Razor code here and there, to keep my options open if I need to add something I can't do in HTML. So I was wondering if I can do this. Can I use Visual Studio to create a simple HTML/CSS web site that allows me to add bits of Razor code if needed? If I can do this, presumably I could later progress onto a more formal MVC architecture if I felt it was needed? And one final part to this question: should I be looking at vanilla Razor or would I be better looking into Blazor? Any help or advice would be very gratefully received. Kind wishes ~ Patrick

      Thank you to anyone taking the time to read my posts.

      Richard DeemingR Offline
      Richard DeemingR Offline
      Richard Deeming
      wrote on last edited by
      #2

      Are you looking for Razor Pages[^]?


      "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

      "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

      P 1 Reply Last reply
      0
      • Richard DeemingR Richard Deeming

        Are you looking for Razor Pages[^]?


        "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

        P Offline
        P Offline
        Patrick Skelton
        wrote on last edited by
        #3

        Thanks for the reply, Richard. I have visited the page you linked in my many travels on the subject but I quickly became unclear about how Razor could in any way stand alone from MVC. Having looked again at the page, I note that there is a separate link for Razor using MVC so I guess that implies what I am looking for is also contained somewhere in that section of MSDN. I'll do more research. I was just hoping to get a few informed comments about my general approach since I don't have too much free time to spend on this and ideally don't want to waste what time I do have wandering down a blind alley. Thanks again for your reply. - Patrick

        Thank you to anyone taking the time to read my posts.

        M 1 Reply Last reply
        0
        • P Patrick Skelton

          Thanks for the reply, Richard. I have visited the page you linked in my many travels on the subject but I quickly became unclear about how Razor could in any way stand alone from MVC. Having looked again at the page, I note that there is a separate link for Razor using MVC so I guess that implies what I am looking for is also contained somewhere in that section of MSDN. I'll do more research. I was just hoping to get a few informed comments about my general approach since I don't have too much free time to spend on this and ideally don't want to waste what time I do have wandering down a blind alley. Thanks again for your reply. - Patrick

          Thank you to anyone taking the time to read my posts.

          M Offline
          M Offline
          MadMyche
          wrote on last edited by
          #4

          Razor is a view engine, just as ASPX is a view engine. The main difference between the two is that ASPX was developed based on the web-forms page model and was adapted for use with MVC. Razor, on the other hand; was built atop the MVC page model and there has been no official adaptation to any other page modeling. There was a Codeplex project for Razor, now on GIT; and a couple years old: [GitHub - Antaris/RazorEngine: Open source templating engine based on Microsoft's Razor parsing engine](https://github.com/Antaris/RazorEngine) There is also a 2-part blog set about how it's put together [Dissecting Razor, part 1: Parts of the framework – SLaks.Blog](https://blog.slaks.net/2011/01/dissecting-razor-part-1-pieces-of.html) With your personal website, I would probably just build an empty MVC project and just fill the Views with your static HTML. Not the most efficient way to do it, however; you will have the framework present to start learning Razor and MVC. As for Blazor, it still is a little young and I don't see too much going on with it to build/promote this.

          Director of Transmogrification Services Shinobi of Query Language Master of Yoda Conditional

          P 1 Reply Last reply
          0
          • M MadMyche

            Razor is a view engine, just as ASPX is a view engine. The main difference between the two is that ASPX was developed based on the web-forms page model and was adapted for use with MVC. Razor, on the other hand; was built atop the MVC page model and there has been no official adaptation to any other page modeling. There was a Codeplex project for Razor, now on GIT; and a couple years old: [GitHub - Antaris/RazorEngine: Open source templating engine based on Microsoft's Razor parsing engine](https://github.com/Antaris/RazorEngine) There is also a 2-part blog set about how it's put together [Dissecting Razor, part 1: Parts of the framework – SLaks.Blog](https://blog.slaks.net/2011/01/dissecting-razor-part-1-pieces-of.html) With your personal website, I would probably just build an empty MVC project and just fill the Views with your static HTML. Not the most efficient way to do it, however; you will have the framework present to start learning Razor and MVC. As for Blazor, it still is a little young and I don't see too much going on with it to build/promote this.

            Director of Transmogrification Services Shinobi of Query Language Master of Yoda Conditional

            P Offline
            P Offline
            Patrick Skelton
            wrote on last edited by
            #5

            That's very helpful! Thank you! I'll take some time to digest what you've written and I'm sure I'll be better informed to decide upon a way forward. - Patrick

            Thank you to anyone taking the time to read my posts.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups