ASP.NET MVC 3 Razor Syntax - Casting

前端 未结 2 570
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-16 10:49

So, simple question really. :)

I had this following code with ASPX View Engine:

<%: ((City)Model.Location).Name %&g         


        
2条回答
  •  Happy的楠姐
    2020-12-16 11:33

    Does @(((City)Model.Location).Name) work? I think it's thinking the expression contained within @() is closed.

提交回复
热议问题