is there any way to use TagHelpers in asp.net mvc 5?












1















Just wanted to utilize the new tag helpers in our 'legacy' asp.net mvc projects because they can help a lot for us I belive.



Installed Microsoft.AspNetCore.Mvc.TagHelpers nuget package but I'm stuck here since lacking of @addTagHelper feature so tag helpers not being processed runtime az all :(



Is it possible to set up solution/razor engine to use it somehow?










share|improve this question




















  • 3





    No, but you can use the standard HTML Helpers which do a lot of the same things. And ASP.NET (non-code) MVC is absolutely not "legacy", it's still fully supported with no roadmap to end that, and so is WebForms for that matter.

    – ADyson
    Mar 23 '18 at 16:02













  • thank you for your response. Could you please elaborate more on "No"? What is missing exactly from non-.core MVC razor engine? The main reason why I intended to use tag helpers is that the mixture of razor and html syntax causes more small bugs runtime and being very disruptive when reading by humans.Html helpers dont solve this problem.

    – Kornel
    Mar 24 '18 at 9:57













  • The older Razor engine simply doesn't understand them. It isn't looking for them and has no idea what to do with them. So what is missing (I assume, I haven't studied it in detail myself), is the code which detects the tag helpers in the markup and acts on them. I'm pretty sure it's all open-source so you could probably compare and contrast the two engines if you really wanted to. But I imagine it would be fairly challenging to backport the feature into the older MVC.

    – ADyson
    Mar 24 '18 at 11:30













  • I agree that the tag-helper syntax is a lot neater and less verbose than the Razor HTML helper syntax, and that's probably why Microsoft changed to using it. But if you're using the older MVC I'm afraid you're probably stuck with the older style of syntax too.

    – ADyson
    Mar 24 '18 at 11:32






  • 2





    If you decide to add support for tag helpers to MVC 5, please be sure to open source the implementation and post it on NuGet. I am sure others would like to "future-proof" their MVC 5 applications so they can more easily be ported to ASP.NET Core later.

    – NightOwl888
    Mar 24 '18 at 20:32
















1















Just wanted to utilize the new tag helpers in our 'legacy' asp.net mvc projects because they can help a lot for us I belive.



Installed Microsoft.AspNetCore.Mvc.TagHelpers nuget package but I'm stuck here since lacking of @addTagHelper feature so tag helpers not being processed runtime az all :(



Is it possible to set up solution/razor engine to use it somehow?










share|improve this question




















  • 3





    No, but you can use the standard HTML Helpers which do a lot of the same things. And ASP.NET (non-code) MVC is absolutely not "legacy", it's still fully supported with no roadmap to end that, and so is WebForms for that matter.

    – ADyson
    Mar 23 '18 at 16:02













  • thank you for your response. Could you please elaborate more on "No"? What is missing exactly from non-.core MVC razor engine? The main reason why I intended to use tag helpers is that the mixture of razor and html syntax causes more small bugs runtime and being very disruptive when reading by humans.Html helpers dont solve this problem.

    – Kornel
    Mar 24 '18 at 9:57













  • The older Razor engine simply doesn't understand them. It isn't looking for them and has no idea what to do with them. So what is missing (I assume, I haven't studied it in detail myself), is the code which detects the tag helpers in the markup and acts on them. I'm pretty sure it's all open-source so you could probably compare and contrast the two engines if you really wanted to. But I imagine it would be fairly challenging to backport the feature into the older MVC.

    – ADyson
    Mar 24 '18 at 11:30













  • I agree that the tag-helper syntax is a lot neater and less verbose than the Razor HTML helper syntax, and that's probably why Microsoft changed to using it. But if you're using the older MVC I'm afraid you're probably stuck with the older style of syntax too.

    – ADyson
    Mar 24 '18 at 11:32






  • 2





    If you decide to add support for tag helpers to MVC 5, please be sure to open source the implementation and post it on NuGet. I am sure others would like to "future-proof" their MVC 5 applications so they can more easily be ported to ASP.NET Core later.

    – NightOwl888
    Mar 24 '18 at 20:32














1












1








1


1






Just wanted to utilize the new tag helpers in our 'legacy' asp.net mvc projects because they can help a lot for us I belive.



Installed Microsoft.AspNetCore.Mvc.TagHelpers nuget package but I'm stuck here since lacking of @addTagHelper feature so tag helpers not being processed runtime az all :(



Is it possible to set up solution/razor engine to use it somehow?










share|improve this question
















Just wanted to utilize the new tag helpers in our 'legacy' asp.net mvc projects because they can help a lot for us I belive.



Installed Microsoft.AspNetCore.Mvc.TagHelpers nuget package but I'm stuck here since lacking of @addTagHelper feature so tag helpers not being processed runtime az all :(



Is it possible to set up solution/razor engine to use it somehow?







c# asp.net-mvc asp.net-core-tag-helpers






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited May 11 '18 at 22:39









Camilo Terevinto

18.5k63666




18.5k63666










asked Mar 23 '18 at 14:51









KornelKornel

61




61








  • 3





    No, but you can use the standard HTML Helpers which do a lot of the same things. And ASP.NET (non-code) MVC is absolutely not "legacy", it's still fully supported with no roadmap to end that, and so is WebForms for that matter.

    – ADyson
    Mar 23 '18 at 16:02













  • thank you for your response. Could you please elaborate more on "No"? What is missing exactly from non-.core MVC razor engine? The main reason why I intended to use tag helpers is that the mixture of razor and html syntax causes more small bugs runtime and being very disruptive when reading by humans.Html helpers dont solve this problem.

    – Kornel
    Mar 24 '18 at 9:57













  • The older Razor engine simply doesn't understand them. It isn't looking for them and has no idea what to do with them. So what is missing (I assume, I haven't studied it in detail myself), is the code which detects the tag helpers in the markup and acts on them. I'm pretty sure it's all open-source so you could probably compare and contrast the two engines if you really wanted to. But I imagine it would be fairly challenging to backport the feature into the older MVC.

    – ADyson
    Mar 24 '18 at 11:30













  • I agree that the tag-helper syntax is a lot neater and less verbose than the Razor HTML helper syntax, and that's probably why Microsoft changed to using it. But if you're using the older MVC I'm afraid you're probably stuck with the older style of syntax too.

    – ADyson
    Mar 24 '18 at 11:32






  • 2





    If you decide to add support for tag helpers to MVC 5, please be sure to open source the implementation and post it on NuGet. I am sure others would like to "future-proof" their MVC 5 applications so they can more easily be ported to ASP.NET Core later.

    – NightOwl888
    Mar 24 '18 at 20:32














  • 3





    No, but you can use the standard HTML Helpers which do a lot of the same things. And ASP.NET (non-code) MVC is absolutely not "legacy", it's still fully supported with no roadmap to end that, and so is WebForms for that matter.

    – ADyson
    Mar 23 '18 at 16:02













  • thank you for your response. Could you please elaborate more on "No"? What is missing exactly from non-.core MVC razor engine? The main reason why I intended to use tag helpers is that the mixture of razor and html syntax causes more small bugs runtime and being very disruptive when reading by humans.Html helpers dont solve this problem.

    – Kornel
    Mar 24 '18 at 9:57













  • The older Razor engine simply doesn't understand them. It isn't looking for them and has no idea what to do with them. So what is missing (I assume, I haven't studied it in detail myself), is the code which detects the tag helpers in the markup and acts on them. I'm pretty sure it's all open-source so you could probably compare and contrast the two engines if you really wanted to. But I imagine it would be fairly challenging to backport the feature into the older MVC.

    – ADyson
    Mar 24 '18 at 11:30













  • I agree that the tag-helper syntax is a lot neater and less verbose than the Razor HTML helper syntax, and that's probably why Microsoft changed to using it. But if you're using the older MVC I'm afraid you're probably stuck with the older style of syntax too.

    – ADyson
    Mar 24 '18 at 11:32






  • 2





    If you decide to add support for tag helpers to MVC 5, please be sure to open source the implementation and post it on NuGet. I am sure others would like to "future-proof" their MVC 5 applications so they can more easily be ported to ASP.NET Core later.

    – NightOwl888
    Mar 24 '18 at 20:32








3




3





No, but you can use the standard HTML Helpers which do a lot of the same things. And ASP.NET (non-code) MVC is absolutely not "legacy", it's still fully supported with no roadmap to end that, and so is WebForms for that matter.

– ADyson
Mar 23 '18 at 16:02







No, but you can use the standard HTML Helpers which do a lot of the same things. And ASP.NET (non-code) MVC is absolutely not "legacy", it's still fully supported with no roadmap to end that, and so is WebForms for that matter.

– ADyson
Mar 23 '18 at 16:02















thank you for your response. Could you please elaborate more on "No"? What is missing exactly from non-.core MVC razor engine? The main reason why I intended to use tag helpers is that the mixture of razor and html syntax causes more small bugs runtime and being very disruptive when reading by humans.Html helpers dont solve this problem.

– Kornel
Mar 24 '18 at 9:57







thank you for your response. Could you please elaborate more on "No"? What is missing exactly from non-.core MVC razor engine? The main reason why I intended to use tag helpers is that the mixture of razor and html syntax causes more small bugs runtime and being very disruptive when reading by humans.Html helpers dont solve this problem.

– Kornel
Mar 24 '18 at 9:57















The older Razor engine simply doesn't understand them. It isn't looking for them and has no idea what to do with them. So what is missing (I assume, I haven't studied it in detail myself), is the code which detects the tag helpers in the markup and acts on them. I'm pretty sure it's all open-source so you could probably compare and contrast the two engines if you really wanted to. But I imagine it would be fairly challenging to backport the feature into the older MVC.

– ADyson
Mar 24 '18 at 11:30







The older Razor engine simply doesn't understand them. It isn't looking for them and has no idea what to do with them. So what is missing (I assume, I haven't studied it in detail myself), is the code which detects the tag helpers in the markup and acts on them. I'm pretty sure it's all open-source so you could probably compare and contrast the two engines if you really wanted to. But I imagine it would be fairly challenging to backport the feature into the older MVC.

– ADyson
Mar 24 '18 at 11:30















I agree that the tag-helper syntax is a lot neater and less verbose than the Razor HTML helper syntax, and that's probably why Microsoft changed to using it. But if you're using the older MVC I'm afraid you're probably stuck with the older style of syntax too.

– ADyson
Mar 24 '18 at 11:32





I agree that the tag-helper syntax is a lot neater and less verbose than the Razor HTML helper syntax, and that's probably why Microsoft changed to using it. But if you're using the older MVC I'm afraid you're probably stuck with the older style of syntax too.

– ADyson
Mar 24 '18 at 11:32




2




2





If you decide to add support for tag helpers to MVC 5, please be sure to open source the implementation and post it on NuGet. I am sure others would like to "future-proof" their MVC 5 applications so they can more easily be ported to ASP.NET Core later.

– NightOwl888
Mar 24 '18 at 20:32





If you decide to add support for tag helpers to MVC 5, please be sure to open source the implementation and post it on NuGet. I am sure others would like to "future-proof" their MVC 5 applications so they can more easily be ported to ASP.NET Core later.

– NightOwl888
Mar 24 '18 at 20:32












1 Answer
1






active

oldest

votes


















2














No, tag helpers are only supported in ASP.NET Core, not in the older ASP.NET (based on the classic .NET Framework, rather than the newer .NET Core).



But instead you can use HTML Helpers which do a lot of the same things.






share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f49452470%2fis-there-any-way-to-use-taghelpers-in-asp-net-mvc-5%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    2














    No, tag helpers are only supported in ASP.NET Core, not in the older ASP.NET (based on the classic .NET Framework, rather than the newer .NET Core).



    But instead you can use HTML Helpers which do a lot of the same things.






    share|improve this answer




























      2














      No, tag helpers are only supported in ASP.NET Core, not in the older ASP.NET (based on the classic .NET Framework, rather than the newer .NET Core).



      But instead you can use HTML Helpers which do a lot of the same things.






      share|improve this answer


























        2












        2








        2







        No, tag helpers are only supported in ASP.NET Core, not in the older ASP.NET (based on the classic .NET Framework, rather than the newer .NET Core).



        But instead you can use HTML Helpers which do a lot of the same things.






        share|improve this answer













        No, tag helpers are only supported in ASP.NET Core, not in the older ASP.NET (based on the classic .NET Framework, rather than the newer .NET Core).



        But instead you can use HTML Helpers which do a lot of the same things.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 14 '18 at 16:10









        ADysonADyson

        24.2k112445




        24.2k112445
































            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f49452470%2fis-there-any-way-to-use-taghelpers-in-asp-net-mvc-5%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Bressuire

            Vorschmack

            Quarantine