Skip to main content

Questions tagged [asp.net-core-tag-helpers]

ASP.NET Core MVC TagHelpers are server-sided classes used for rendering HTML content. They react to specific HTML tags or attributes within Razor views, and can alter and generate new markup. They're a modern alternative to the ASP.NET MVC Html Helpers.

asp.net-core-tag-helpers
1 vote
1 answer
38 views

How to pass a Guid to a property on a Tag Helper in ASP.NET Core

I have a custom TagHelper I need to pass a Guid to, but I get errors when I pass the value. How can I pass in a Guid? TagHelper: [HtmlTargetElement("assets:signin", Attributes = "...
Stein Lundbeck Tech's user avatar
0 votes
1 answer
45 views

Optionally invoke tag helpers in Razor page

This select will be populated normally: <select ... [email protected] asp-items=Model.Products> </select> Sometimes I want to render it as empty; I tried: <select ... @if (!...
lonix's user avatar
  • 17.7k
0 votes
0 answers
29 views

Display a formatted date of CurrentUICulture in EditorFor()

So I've been trying to "convert" a property of type DateTime to a formatted localized string to then display in a date input field. My model's property: [Display(Name = "StartingDate&...
Gogo Dev's user avatar
  • 126
0 votes
0 answers
35 views

Custom tag helper automatically removes attributes from markup

Consider a custom tag helper with this: [HtmlTargetElement("a", Attributes = "custom")] public class CustomTagHelper : TagHelper { [HtmlAttributeName("foo")] public ...
lonix's user avatar
  • 17.7k
0 votes
0 answers
41 views

Use Intellisense for ASP.NET Core areas, controllers and actions in Custom View Components

I guess everyone is familiar with the ASP.NET Core taghelpers like form where you can use the attributes like asp-area to get intellisense for the areas, controllers or actions. I would like the same ...
modmoto's user avatar
  • 3,180
1 vote
1 answer
81 views

Tag helpers in ASP.NET Core 8 MVC

The ASP.NET Core MVC tag helpers aren't acting like they used to. When I write something like this: <a asp-area="Admin" asp-controller="Home" asp-action="Index"><...
Sina Abbaszadeh's user avatar
1 vote
1 answer
84 views

Asp.net Core Razor Pages - Custom TagHelpers & Boiler plate CRUD code

I'm sure this problem has been faced many times before. I have a lot of CRUD forms, so I have a lot of repeated boiler plate code. e.g. <div class="form-group"> <label asp-for=&...
HelpMe's user avatar
  • 21
0 votes
1 answer
40 views

custom TagHelper is not being rendered [duplicate]

I want to port a very old pdf processing application to .Net and in the process convert handelbars templates to Razor. I am scratching my head on why a TagHelper is not being picked up. namespace ...
Marco's user avatar
  • 23.5k
0 votes
1 answer
32 views

Replicate asp-for functionality on any element

ASP.NET Core's <input> and <label> tag helpers support the asp-for property, which generates id, name and for appropriately. Is it possible to get those values somehow and use them on some ...
lonix's user avatar
  • 17.7k
0 votes
1 answer
37 views

how to get the html for a tag helper in code

I have some tag helpers I need to "render" in code, meaning I'm looking to get the html that would be used in a view. How can I get a HTML string representation of a tag helper? Here's just ...
Stein Lundbeck Tech's user avatar
1 vote
2 answers
53 views

TagHelpers Not Functioning in New Area

I created a new area on a project to separate concerns. However, I just ran into a strange issue where the taghelpers aren't working correctly, not even constructing the correct URL at all. The ...
Nick Fleetwood's user avatar
0 votes
0 answers
72 views

Sitecore Experience Editor Links Not Editable

When trying to edit items in Sitecore experience editor, editing links does not work. When I click on them i select the parent item instead of the link itself. If I click a second time it follows the ...
Conner's user avatar
  • 9
0 votes
2 answers
113 views

Button with type reset not working for ASP.NET Core select tag helper

I have a form with a button with type "reset". But after clicking it, it doesn't reset the select tag helper items. How can I solve it in the practical and easiest way? I'm using ASP.NET ...
nima ansari's user avatar
0 votes
0 answers
57 views

I wrote a taghelper class and then i add it to my _viewImport . but it isn't known in my layout

I wrote this tagHelper class //[HtmlTargetElement("MenuItem")] public class MenuItemTagHelper : TagHelper { private readonly IGetMenuItemService getMenuItemService; public ...
soraya's user avatar
  • 1
0 votes
1 answer
60 views

How to convert TaghelperContent to TagBuilder?

How to convert TaghelperContent to TagBuilder? For example, i have below taghelper: [HtmlTargetElement("custom-tag")] public class CustomTag: TagHelper { public async override Task ...
Topik's user avatar
  • 41

15 30 50 per page
1
2 3 4 5
25