Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法在 razor 脚本中重用 razor 脚本,这样在 BaseRazorScript 中定义的 C# 中的 @functions{...} 可以在重用 BaseRazorScript 文件的 razor 脚本中调用?
您可以使用部分。例如:
@Html.Partial("nameofyourparital.cshtml")
您必须将部分文件放在~/views/partial/或~/views/shared/文件夹中