In-Depth

Q&A: Robert Boedigheimer on ASP.NET Core 1.0 Tag Helpers

Find out more about this new feature of ASP.NET Core 1.0 and how it might help you.

ASP.NET Core 1.0 has introduced Tag Helpers, which are a much more HTML-centric approach to using server-side code to help construct HTML elements in Razor views. At Visual Studio Live! Las Vegas 2017, Robert Boedigheimer, principal systems developer at Schwans Shared Services, will talk all about ASP.NET Core 1.0 Tag Helpers during his session on the topic, covering issues such as how to use built-in Tag Helpers for downloading specific JavaScript and CSS, comparing Tag Helpers with existing HTML Helpers, and how to create custom ones.

We recently asked him for a bit of a preview on the topic:

What would you say the top three benefits of using Tag Helpers? 
First, you get a more HTML-like syntax than pre-existing HTML Helpers in Razor files. Second, there are many built-in Tag Helpers that simplify common tasks that many Web sites will encounter. Third, there is a server-side mechanism for creating custom reusable HTML elements or attributes to render HTML.

What are the top built-in tag helpers devs should know about?

  1. <environment> -- to include content only when on a particular level of server (development, stage, production).
  2. asp-append-version -- adds a version number to URLs to override caches and ensure the latest version is used.
  3. asp-fallback-href -- can specify a local file to use if a file doesn't properly download from a CDN.

What ways do you like to use Tag Helpers?
I like to use the built-in Tag Helpers where available. The ability to build custom Tag Helpers provides a great mechanism to provide reusable server-side functionality for a Web site. My session will review how to build custom Tag Helpers to utilize responsive images using the latest srcset attribute and <picture> tag.

Do Tag Helpers ever get in the way? 
The nice thing is you don't have to use them if you don't want to, and you can selectively disable on particular elements.

What is the best thing that people will get out of attending your session?
An understanding of the built-in tag helpers and how to create your own.

Is there anything you wish we asked you that we didn't?
Yes, I really am a third-degree black belt in Tae Kwon Do, can break bricks and use nun-chucks, but won't be doing that for this session!

Thanks Robert!

About the Author

Becky Nagel serves as vice president of AI for 1105 Media specializing in developing media, events and training for companies around AI and generative AI technology. She also regularly writes and reports on AI news, and is the founding editor of PureAI.com. She's the author of "ChatGPT Prompt 101 Guide for Business Users" and other popular AI resources with a real-world business perspective. She regularly speaks, writes and develops content around AI, generative AI and other business tech. She has a background in Web technology and B2B enterprise technology journalism.

comments powered by Disqus

Featured

  • Cloud-Focused .NET Aspire 9.1 Released

    Along with .NET 10 Preview 1, Microsoft released.NET Aspire 9.1, the latest update to its opinionated, cloud-ready stack for building resilient, observable, and configurable cloud-native applications with .NET.

  • Microsoft Ships First .NET 10 Preview

    Microsoft shipped .NET 10 Preview 1, introducing a raft of improvements and fixes across performance, libraries, and the developer experience.

  • C# Dev Kit Previews .NET Aspire Orchestration

    Microsoft's dev team has been busy updating the C# Dev Kit, a Visual Studio Code extension that enhances the C# development experience by providing tools for managing, debugging, and editing C# projects.

  • Hands On: New VS Code Insiders Build Creates Web Page from Image in Seconds

    New Vision support with GitHub Copilot in the latest Visual Studio Code Insiders build takes a user-supplied mockup image and creates a web page from it in seconds, handling all the HTML and CSS.

  • Naive Bayes Regression Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the naive Bayes regression technique, where the goal is to predict a single numeric value. Compared to other machine learning regression techniques, naive Bayes regression is usually less accurate, but is simple, easy to implement and customize, works on both large and small datasets, is highly interpretable, and doesn't require tuning any hyperparameters.

Subscribe on YouTube

Upcoming Training Events