行尾不需要加分号,加上也無妨(不過得全加上)。
必須在 Views 檔案夾中的 Web.config 檔案中添加引用。見下圖:

打開該檔案,找到 system.web.webPages.razor 配置節,在其中的 namespaces 中加入:
效果如下:
配置隻對目前 View 檔案夾(包含各級子目錄)下的頁面生效。如果你使用了 Area , 将會有多個 Views 檔案夾,則需要逐一設定。
在配置檔案中引入命名空間後,已打開的頁面可能不會立即生效,關閉頁面再打開後一般就可以了。
本人 MVC 文章,歡迎閱讀:
<a href="http://www.cnblogs.com/ldp615/archive/2010/12/29/asp-net-mvc-create-model-binder-to-trim-all-string.html">ASP.NET MVC:建立 ModelBinder 自動 Trim 所有字元串</a> <a href="http://www.cnblogs.com/ldp615/archive/2010/11/10/asp-net-mvc-lower-case-url-route.html">ASP.NET MVC:自定義 Route 以生成小寫的 Url</a> <a href="http://www.cnblogs.com/ldp615/archive/2010/10/27/asp-net-mvc-forms-authentication-roles-authorization-demo.html">ASP.NET MVC:窗體身份驗證及角色權限管理示例</a> <a href="http://www.cnblogs.com/ldp615/archive/2010/10/22/asp-net-mvc-request-handling-pipeline-poster.html">ASP.NET MVC : 請求處理流程 (Request-Handling Pipeline)</a> <a href="http://www.cnblogs.com/ldp615/archive/2010/09/17/asp-net-mvc-file-result.html">ASP.NET MVC:通過 FileResult 向浏覽器發送檔案</a> <a href="http://www.cnblogs.com/ldp615/archive/2010/07/30/SensitiveWordsFilterModelBinder.html">ASP.NET MVC: 使用自定義 ModelBinder 過濾敏感資訊</a> <a href="http://www.cnblogs.com/ldp615/archive/2010/07/29/SensitiveWordsFilterAttribute.html">ASP.NET MVC: 使用 Filters 附加過濾敏感資訊功能</a> <a href="http://www.cnblogs.com/ldp615/archive/2010/04/17/TextBoxFor.html">c#擴充方法奇思妙用 ASP.NET MVC 篇:巧用擴充方法優先級,美化所有頁面 TextBoxFor 文本框</a>