使用<a href="" in="" a="" view="" in="" asp.net="" mvc?=""

时间:2018-11-22 20:17:56

标签: asp.net-mvc asp.net-core asp.net-core-mvc asp.net-core-2.0 asp.net-core-2.1

="" In asp.net mvc, mainly in .netcore version, we have some htmlhelpers and taghelpers who help us coding our front end.

I have more affinity with pure html than taghelpers or htmlhelpers.

I'd like to know if it's wrong use some tags in pure html like <a href>, <label>, <span> and so on even if the .netcore provides taghelpers or htmlhelpers for that

1 个答案:

答案 0 :(得分:1)

不,使用html锚标签而不是标签帮助程序不是轻率也不是坏习惯。我见过很多带有纯HTML锚的项目,这些项目易于阅读和维护。

如果您使用的是命名路由,则HTML帮助程序可能会节省一些重构,因为您可以在路由配置中更改控制器和操作,而不必更新链接。但是,如果这对您来说没什么大不了的,那就不用担心。

相关问题