2012-01-31 21 views
0

我有一些从外部项目导入的HTML助手。我如何在ASPX文件中引用它们?添加对ASP.NET MVC ASPX页面的引用

目前我得到类似如下的错误:

Compilation Error 
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. 

Compiler Error Message: CS1061: 'System.Web.Mvc.HtmlHelper<LC.TLAdminMVC.DAL.BusinessObjects.CompanySingleViewModel>' does not contain a definition for 'Configurator' and no extension method 'Configurator' accepting a first argument of type 'System.Web.Mvc.HtmlHelper<LC.TLAdminMVC.DAL.BusinessObjects.CompanySingleViewModel>' could be found (are you missing a using directive or an assembly reference?) 
+0

可能的重复[是否可以在我的aspx视图中使用'using'语句? (ASP.NET MVC)](http://stackoverflow.com/questions/1697169/is-it-possible-to-use-the-using-statement-in-my-aspx-views-asp-net-mvc) – Eranga 2012-01-31 06:34:40

回答

0

为了更好地了解你的情况,你可以回答一个问题。

你把助手方法放在aspx文件里面还是外部?

如果它们是外部的:

  1. 让您的解决方案目录名为:的app_code
  2. 创建一个新的文件,无论名称(我们就叫它“内容”)
  3. 当你想使用辅助方法只需要调用Content.methodName(PARAMS)

如果他们内部:

尝试检查它们是否嵌套在块中。

希望这会有所帮助,