-
ASP .Net Core Razor SPA vs. MVC Taghelpers Navigation
As I mess about with deciding- do I want to do Razor SPA pages or do a full on ASP.Core MVC pages for my latest Web App? I noticed something when- Yes I put both in a solution- it comes to the ASP tag helper for navigation links…
So here’s the thing. For a regular ASP.Core MVC we see tag helper navigations look like this:
<a class="nav-link" asp-controller="Home" asp-action="Index">Home</span></a>
Simple enough… “asp-controller” has the simple controller name, and “asp-action” the action within the controller… no problem
Now consider Razor SPA or just simple razor pages:
<a class="nav-link text-dark btn btn-outline-info" asp-page="/Index" data-toggle="tooltip" data-placement="top" title="Always Takes you back Home">Home</a>
Here we have a “asp-page”. Ok, I do get it… Razor SPA or Razor Pages do not follow the MVC pattern with a controller etc. But why do they need to be different? Yes I understand MVC came first and it is very understandable to have a clear navigation tag helper. But again, why not just one simple tag helper that sorts out where the page and/or controller is?
This gets even more complex – mostly- when one considers “Areas”.
Again very well defined for an MVC pattern. But to use within Razor Pages, you have to muck about with making sure this is available in your Startup.ConfigureServices. Why oh WHY?
services.AddMvc() .AddRazorPagesOptions(options => options.AllowAreas = true);
Maybe some day this will evaporate, but for now… no.
fyi… as this applies to ASP.Net Core 2.2, the doc reference is here:
Anchor Tag Helper in ASP.NET Core
Anchor Tag Helper in ASP.NET Core
Discover the ASP.NET Core Anchor Tag Helper attributes and the role each attribute plays in extending behavior of the HTML anchor tag.
Happy tagging,
~SG -
The Getting started with Xamarin and matters Virtual
The main landing that I can’t ever seem to remember to start with is actually here:
Installing and Setting Up Xamarin.Android – Xamarin
Installing and Setting Up Xamarin.Android – Xamarin
How to install and configure Xamarin.Android to work with Visual Studio.
Source: docs.microsoft.com/en-us/xamarin/android/get-started/installation/
The next important part is when you are setting up HAXM (for intel based chips)
From a cmd window.
sc query intelhaxm (and if it is not already installed go here HAXM Release on GitHub
sc stop intelhaxm – to stop the service
sc start intelhaxm – to start the serviceYou can also use Hyper-V (sometimes I have issue with this method because it likes to mess about with my wifi/lan connections- that’s sometimes not a pretty sight in Windows 10).
-
It’s Always the Little stuff
How many times over the years of using Visual Studio have I’ve added the two lines of code to my console apps (mostly quick simple or testing console apps):
Console.WriteLine("**Press"); Console.ReadLine();
I know it’s been there since sometime in Visual Studio 2017 … Yes the setting that removes the need for those two lines of code…
Tools => Options => Debugging => General… The magic check box labelled:
‘Automatically close the console when debugging stops’
The simple sweetness of that single setting! A Millionth of a Penny for every time I had to go back in put those two lines of code in my console apps…
I humbly submit this as proof positive… that it is the simple things that make the difference! 😎
ScottGeek
-
.Net Core ASP Tag Helpers
I has to be one of the most useful things added… You got Tag Helps…
Consider the simplest example…
<img src="/images/somePng.png" />
Not hard and very common. But consider the task of versioning your images for a web page… Enter Tag Helpers
<img src="/images/somePng.png" asp-append-version = "true"/>
This gives us a Hash version appended, so if an image changes? Indeed yes the hash value changes and this will trigger a cached page to update the image.
Wow, Tag Helpers… very handy.
ScottGeek
-
Build 2019: The On-Demand Sessions
Here’s the main link… watch them while they are available.
Microsoft Build 2019 Announcements | Microsoft Azure
Microsoft Build 2019 Announcements | Microsoft Azure
Discover the latest announcements from Microsoft Build 2019, the premier developer conference from Microsoft.
-
Build 2019 Keynote: That ‘Red’ Shirt Guy
Always a good listen:
Microsoft Build 2019 Developer Conference May 6-8 Seattle, WA
Microsoft Build 2019 Developer Conference May 6-8 Seattle, WA
Join developers and industry experts at Microsoft Build to explore the latest developer tools and technologies. #MSBuild
Source: Microsoft Build
Ok MS stop changing the link already….
Or is it this one:
Microsoft Build 2019 Developer Conference May 6-8 Seattle, WA
Microsoft Build 2019 Developer Conference May 6-8 Seattle, WA
Join developers and industry experts at Microsoft Build to explore the latest developer tools and technologies. #MSBuild
-
Build 2019 Session: Edge Architecture the Azure SQL DB Edge
What is ‘Edge’ umm… let’s see.
Microsoft Build 2019 Developer Conference May 6-8 Seattle, WA
Microsoft Build 2019 Developer Conference May 6-8 Seattle, WA
Join developers and industry experts at Microsoft Build to explore the latest developer tools and technologies. #MSBuild
Source: Simplify Edge Architecture with Azure SQL Database Edge
-
Build 2019 Session: AI and the Cloud Vision
AI and the Cloud Vision- I’m not 100% I understand many humans, but I’m still learing:
Microsoft Build 2019 Developer Conference May 6-8 Seattle, WA
Microsoft Build 2019 Developer Conference May 6-8 Seattle, WA
Join developers and industry experts at Microsoft Build to explore the latest developer tools and technologies. #MSBuild
Source: 5 industries that are getting disrupted by Computer Vision on Cloud and on Edge
-
Build 2019 Keynote: Shall We Begin
The words from the top:
Microsoft Build 2019 Developer Conference May 6-8 Seattle, WA
Microsoft Build 2019 Developer Conference May 6-8 Seattle, WA
Join developers and industry experts at Microsoft Build to explore the latest developer tools and technologies. #MSBuild
Source: Vision Keynote – Satya Nadella
-
Build 2019 Session: The look back on C#
Interesting step back as we move forward with C#. It’s good to know where and how it came from:
Microsoft Build 2019 Developer Conference May 6-8 Seattle, WA
Microsoft Build 2019 Developer Conference May 6-8 Seattle, WA
Join developers and industry experts at Microsoft Build to explore the latest developer tools and technologies. #MSBuild
Source: ‘Look Back’ on C#