JuergenGutsch / blog

Personal blog about web development based on .NET and .NET Core
https://asp.net-hacker.rocks/
Other
31 stars 17 forks source link

10 ways to extend your Razor views in ASP.NET core - the complete overview #38

Open JuergenGutsch opened 5 years ago

JuergenGutsch commented 5 years ago

Written on 19.02.2016 16:10:33

URL: http://asp.net-hacker.rocks/2016/02/18/extending-razor-views.html

JuergenGutsch commented 5 years ago

Comment written by Ehsan Elhampour on 11.04.2016 08:16:52

thank you for your useful post , but for the new tag helper , i cant make my own custom tag helper i have problem in adding the reference of the tag helper in razor views. do you have any good sample code in this area, i really appreciate it.

JuergenGutsch commented 5 years ago

Comment written by Jürgen Gutsch on 11.04.2016 21:10:58

Hi,
Many thanks for your comment :)

First you need to register the TagHelpers in the _ViewImports.cshtml like this:
@addTagHelper "*, YourProjectName"
You also need a reference to "Microsoft.AspNet.Tooling.Razor": "1.0.0-rc1-final" in the project.json
If you still have problems, I need some more details or just try to google for "ASP.NET Core TagHelpers", there are a lot of tutorials and blog posts out there

Cheers,
Juergen

JuergenGutsch commented 5 years ago

Comment written by Luis Salgado on 30.06.2016 17:34:08

what is a "clean coder"?

JuergenGutsch commented 5 years ago

Comment written by Jürgen Gutsch on 04.07.2016 08:00:09

Someone how tries to consider the patterns defined in this book while writing code: https://www.amazon.com/Clea...

JuergenGutsch commented 5 years ago

Comment written by Jorn Theunissen on 01.08.2016 17:27:50

Thanks for the great article. Bookmarked it for future reference.

JuergenGutsch commented 5 years ago

Comment written by Jürgen Gutsch on 02.08.2016 07:49:52

Hi Jorn, many thanks. glad you like it :)

JuergenGutsch commented 5 years ago

Comment written by mantaDolphin on 09.08.2016 03:49:37

Great stuff, very timely and informative, I do believe we are closer to reusable interactive containers for views and pages. Looking forward to future articles.

JuergenGutsch commented 5 years ago

Comment written by Jürgen Gutsch on 09.08.2016 08:02:49

Glad you like that post :)

JuergenGutsch commented 5 years ago

Comment written by Francisco Rodriguez on 25.12.2016 00:43:48

Thank you for this great article!

JuergenGutsch commented 5 years ago

Comment written by Samseen on 19.04.2017 01:42:45

Nice article Jurgen, However, I am just starting out with ASP.NET and I cloned a project form GitHub. I found out that as robust as the program looks, there are no files in the VIEW folder and it defies everything I am learning or seeing around. But I noticed that there are a lot of .html files outside the views folder which I presume will be rendered as the view. Now, my question is that, how will this be viewed in the browser? Or how do I reference it as a View? Thank you. https://uploads.disquscdn.c...

JuergenGutsch commented 5 years ago

Comment written by Samseen on 19.04.2017 14:08:49

Thank you... I've figured it out. I just had to visit localhost:xxxxx/first.html!

JuergenGutsch commented 5 years ago

Comment written by Alexander on 25.04.2017 18:27:01

You're forgetting #11 'razor template delegates'. (http://haacked.com/archive/...

JuergenGutsch commented 5 years ago

Comment written by Jürgen Gutsch on 25.04.2017 20:46:21

Great, Thanks :) If it's possible in ASP.NET Core, I'll add it as #11 :)

JuergenGutsch commented 5 years ago

Comment written by Bastien on 25.06.2017 12:06:35

Someone who is not thinking "shit in, shit out" while reversing and refactoring the colleague`s code :-) This is the more inofficial meaning.

JuergenGutsch commented 5 years ago

Comment written by MrNams on 09.08.2018 20:11:05

Tons of thanks for sharing this great article.

JuergenGutsch commented 5 years ago

Comment written by Jorn Theunissen on 12.11.2018 10:37:18

I bookmarked this topic almost 3 years ago. It would be cool to see which of the mentioned topics are still relevant and which topics are new/more powerful 3 years later.

JuergenGutsch commented 5 years ago

Comment written by Jürgen Gutsch on 12.11.2018 10:41:00

Hi Jorn, many thanks for your comment.
This is a great idea. I'll create a follow-up post as soon as possible :-)
Cheers