I'm building an ASP.Net MVC website. Rather than have everything in one project, I've decided to separate the Web, Model and Controller out into different projects in the same solution, that reference eachother.
The referencing goes like this:
Web ---[references]---> Controller ---[references]---> Model
Now I wanted to add 2 custom methods to the HtmlHelper class - they're called "IncludeScript" and "IncludeStyle". They each take a single string parameter, and generate a script or link tag respectively.
I've created an extender class, according to documentation on the web, and written the two methods and compiled the application.
Now, when I go into the Public.Master page (which is my main master-page, and one of the places where I intend to use these methods), I can enter code such as below:
<%= Html.IncludeScript("\js\jquery.js") %>
The IntelliSense picks up and IncludeScript method and shows me the syntax just fine. So I'd expect that everything should work.
But it doesn't.
Everything compiles, but as soon as I run the application, I get the following run-time error from line 14 of Default.aspx.cs:
c:\\Projects\\PhoneReel\\PhoneReel.Web\\Views\\Shared\\Public.Master(11): error CS0117: 'System.Web.Mvc.HtmlHelper' does not contain a definition for 'IncludeScript'
Here's the line of code that the error happens on:
httpHandler.ProcessRequest(HttpContext.Current);
Any ideas what could be going wrong here?