I\'ve been trying to run ASP.Net MVC 1.0 on one machine, but can\'t get past this. I create a new MVC project (C#). It creates all the folders, views, controllers, models
Just trying to rule out the obvious here, but can you make sure have this in the namespaces section of the web.config?
<add namespace="System.Web.Mvc.Html"/>
Since you are referencing it in your Code Behind (ie. Default.aspx.cs) you need to include the namespace at the top of the file.
using System.Web.Mvc.Html;
is the Namespace that includes the RenderPartial extension method.
You may think this is dumb, but I just had the same problem. I had a working MVC app, running 1.0.0.0 and all of a sudden it stopped working giving me the same RenderPartial isn't in the definition. Well it turns out that while I was going crazy cleaning up my web.config, I removed this section. When I re-added it, everything worked again. I'm sure this has something to do with how the class extensions load during runtime.
Anyway, re-adding this to my web.config worked on my machine. ;)
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs" warningLevel="4"
type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<providerOption name="CompilerVersion" value="v3.5"/>
<providerOption name="WarnAsError" value="false"/>
</compiler>
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" warningLevel="4"
type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<providerOption name="CompilerVersion" value="v3.5"/>
<providerOption name="OptionInfer" value="true"/>
<providerOption name="WarnAsError" value="false"/>
</compiler>
</compilers>
</system.codedom>
Another possible problem (depending on your error string) is that the extension method is there, but that the compiler couldn't match up your parameters to the known method parameters. I ran into this using T4MVC (noob) and forgetting to add ActionNames before the name of the action I was calling.
According to your error message, you are referencing System.Web.Mvc.HtmlHelper
. I am looking at the System.Web.Mvc
dll in Reflector, and it's telling me that RenderPartial
resides in the namespace System.Web.Mvc.Html
, not System.Web.Mvc.HtmlHelper
.