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.
是否可以使用剃须刀引擎声明属性,例如
Hello @customername
而不是喜欢
Hello @Model.customername
据我所知,您需要 @Model 来检索客户名称。您可以在代码的开头创建一个变量并使用 customerName 填充它,但无论哪种方式,您至少需要一次 @Model。
var customerName = @Model.customername; Hello @customername