{"id":5931,"date":"2019-12-18T17:05:06","date_gmt":"2019-12-18T17:05:06","guid":{"rendered":"https:\/\/max-drake.cc\/?p=5931"},"modified":"2019-12-18T17:05:06","modified_gmt":"2019-12-18T17:05:06","slug":"tutorial-get-started-with-razor-pages-in-asp-net-core","status":"publish","type":"post","link":"https:\/\/max-drake.cc\/?p=5931","title":{"rendered":"Tutorial: Get started with Razor Pages in ASP.NET Core"},"content":{"rendered":"\n<p>After playing with Azure I was in the MS(Microsoft) headspace and while browsing the net I came across a website with a .asp extension, so I thought i&#8217;d look at building a website with ASP.NET Core. <br>  So after figuring out the difference between ASP.NET and ASP.NET Core, core being the updated method which is cross platform whereas Net is only for windows. I thought I&#8217;d have a go at the tutorial for building a &#8220;SIMPLE&#8221; webpage. Then I came across MVC ( Model, Controller, View) for web sites. A bit complicated, although I had come across the concept with PHP CodeIgniter, and I didn&#8217;t fare too well then, I was using CRUD processes for displaying data in a web page.<br> So I&#8217;m doing a basic tutorial with a Razor Page setup (that then Builds Model and I presume a Controller) which is for a Movie DataBase webpage build, so I thought I&#8217;d follow that. <br> The link to the tutoriasl is <strong><a rel=\"noreferrer noopener\" aria-label=\"HERE (opens in a new tab)\" href=\"https:\/\/docs.microsoft.com\/en-us\/aspnet\/core\/tutorials\/razor-pages\/model?view=aspnetcore-3.1&amp;tabs=visual-studio\" target=\"_blank\">HERE<\/a><\/strong>.<\/p>\n\n\n\n<p>After updating VS from 16.3.10 to 16.4.2 the web .NetCore template had a bug and wouldn&#8217;t let me proceed. I just kept on getting error logs. It took me a while to figure out how to drop the templates (via the VS installer &#8211; untick all the boxes) and re-install the templates. It would not make a Scaffold (I think that creates an SQLite DB and links to it). So a few wasted hours re-setting up VS to get it running again. So back on track of page 2 of the tutorial. <\/p>\n\n\n\n<p>I worked on with the tutorial and finally got it working. So have now got a CRUD with lightweight database for films. There were a couple of gotcha&#8217;s in the tutorial, the erros showed up and I finally figured out what to do. Not a well written tutorial for beginners, I think there was a presumption regarding the familiarity of student with C# and Vis Studio. Anyway, I follwed through and got it running. <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"502\" data-src=\"https:\/\/max-drake.cc\/wp-content\/uploads\/2019\/12\/2019-12-19-16_59_45-Index-Movie-1024x502.jpg\" alt=\"\" class=\"wp-image-5932 lazyload\" data-srcset=\"https:\/\/max-drake.cc\/wp-content\/uploads\/2019\/12\/2019-12-19-16_59_45-Index-Movie-1024x502.jpg 1024w, https:\/\/max-drake.cc\/wp-content\/uploads\/2019\/12\/2019-12-19-16_59_45-Index-Movie-300x147.jpg 300w, https:\/\/max-drake.cc\/wp-content\/uploads\/2019\/12\/2019-12-19-16_59_45-Index-Movie-768x377.jpg 768w, https:\/\/max-drake.cc\/wp-content\/uploads\/2019\/12\/2019-12-19-16_59_45-Index-Movie-100x49.jpg 100w, https:\/\/max-drake.cc\/wp-content\/uploads\/2019\/12\/2019-12-19-16_59_45-Index-Movie-204x100.jpg 204w, https:\/\/max-drake.cc\/wp-content\/uploads\/2019\/12\/2019-12-19-16_59_45-Index-Movie-1305x640.jpg 1305w, https:\/\/max-drake.cc\/wp-content\/uploads\/2019\/12\/2019-12-19-16_59_45-Index-Movie-640x314.jpg 640w, https:\/\/max-drake.cc\/wp-content\/uploads\/2019\/12\/2019-12-19-16_59_45-Index-Movie.jpg 1413w\" data-sizes=\"(max-width: 1024px) 100vw, 1024px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1024px; --smush-placeholder-aspect-ratio: 1024\/502;\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"663\" height=\"873\" data-src=\"https:\/\/max-drake.cc\/wp-content\/uploads\/2019\/12\/2019-12-19-16_59_22-Edit-Movie.jpg\" alt=\"\" class=\"wp-image-5933 lazyload\" data-srcset=\"https:\/\/max-drake.cc\/wp-content\/uploads\/2019\/12\/2019-12-19-16_59_22-Edit-Movie.jpg 663w, https:\/\/max-drake.cc\/wp-content\/uploads\/2019\/12\/2019-12-19-16_59_22-Edit-Movie-228x300.jpg 228w, https:\/\/max-drake.cc\/wp-content\/uploads\/2019\/12\/2019-12-19-16_59_22-Edit-Movie-100x132.jpg 100w, https:\/\/max-drake.cc\/wp-content\/uploads\/2019\/12\/2019-12-19-16_59_22-Edit-Movie-76x100.jpg 76w, https:\/\/max-drake.cc\/wp-content\/uploads\/2019\/12\/2019-12-19-16_59_22-Edit-Movie-486x640.jpg 486w, https:\/\/max-drake.cc\/wp-content\/uploads\/2019\/12\/2019-12-19-16_59_22-Edit-Movie-640x843.jpg 640w, https:\/\/max-drake.cc\/wp-content\/uploads\/2019\/12\/2019-12-19-16_59_22-Edit-Movie-583x768.jpg 583w\" data-sizes=\"(max-width: 663px) 100vw, 663px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 663px; --smush-placeholder-aspect-ratio: 663\/873;\" \/><\/figure>\n\n\n\n<p>Frankly this is a bloody hard method to get a page up with a database behind. Just as much a pain as CodeIgniter.This environment is pretty confusing. <\/p>\n\n\n\n<p>I sort of fumbled through the tutorial. Still there was a bit of learning there, but not too much <\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Transfer to Website<\/h3>\n\n\n\n<p>I&#8217;d like to take the page, which runs on my localhost and put it across on my windows server which is running windows. That doesn&#8217;t seem too obvious . I did a build for a RELEASE, on ANY CPU with IIS Express but there is no HTML page to put up on a website, so still a bit of learning to do. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>After playing with Azure I was in the MS(Microsoft) headspace and while browsing the net I came across a website with a .asp extension, so I thought i&#8217;d look at building a website with ASP.NET Core. So after figuring out the difference between ASP.NET and ASP.NET Core, core being the updated method which is cross [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":5932,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[36,29],"tags":[],"class_list":["post-5931","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-databases","category-web"],"featured_image_src":"https:\/\/max-drake.cc\/wp-content\/uploads\/2019\/12\/2019-12-19-16_59_45-Index-Movie.jpg","featured_image_src_square":"https:\/\/max-drake.cc\/wp-content\/uploads\/2019\/12\/2019-12-19-16_59_45-Index-Movie.jpg","author_info":{"display_name":"Max Drake","author_link":"https:\/\/max-drake.cc\/?author=1"},"_links":{"self":[{"href":"https:\/\/max-drake.cc\/index.php?rest_route=\/wp\/v2\/posts\/5931","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/max-drake.cc\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/max-drake.cc\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/max-drake.cc\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/max-drake.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5931"}],"version-history":[{"count":0,"href":"https:\/\/max-drake.cc\/index.php?rest_route=\/wp\/v2\/posts\/5931\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/max-drake.cc\/index.php?rest_route=\/wp\/v2\/media\/5932"}],"wp:attachment":[{"href":"https:\/\/max-drake.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5931"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/max-drake.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5931"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/max-drake.cc\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5931"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}