[solved in v2.5]Unrecognized methods and classes within plugin view

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
12 years ago
Hi,

I'm developing a plugin using ExternalAuth.OpenId(v2.4) as starting ground. The latter works fine but after I edit a c# section for PublicInfo.cshtml in VS2010(e.g just add a space) I get the following error messages:

1. 'System.Web.Mvc.HtmlHelper<dynamic>' does not contain a definition for 'AddCssFileParts' and no extension method 'AddCssFileParts' accepting a first argument of type 'System.Web.Mvc.HtmlHelper<dynamic>' could be found (are you missing a using directive or an assembly reference?)

2. 'System.Web.Mvc.HtmlHelper<dynamic>' does not contain a definition for 'AddScriptParts' and no extension method 'AddScriptParts' accepting a first argument of type 'System.Web.Mvc.HtmlHelper<dynamic>' could be found (are you missing a using directive or an assembly reference?)

3. The name 'Request' does not exist in the current context.

I might just ignore it but I don't its a good idea.
12 years ago
Have you added required Nop.Web.Framework.dll assembly?
Also try adding @using Nop.Web.Framework.UI to your PublicInfo.cshtml file
12 years ago
Thanks Andrei,
Adding @using Nop.Web.Framework.UI duly solved errors 1 & 2 but it didn't work for Request. Here's the offending code:

@using (Html.BeginRouteForm(... ReturnUrl = Request.QueryString["ReturnUrl"] ...)){...}
12 years ago
http://stackoverflow.com/questions/2888105/how-to-access-querystring-in-asp-net-mvc-view
12 years ago
Ok, I got around error 3 with this:
@using (Html.BeginRouteForm(
... ReturnUrl = HttpContext.Current.Request.QueryString["ReturnUrl"] ...)){...}

However I think those little changes need to be included in the next release to avoid scaring away potential plugin developers. I got those errors before I even made any change to the original code.
12 years ago
Already done
12 years ago
Great, but you've still missed out error 3. I know its a very minor issue but if you take if from the point of view of a newbie trying to wrap his head around a plugin architecture you'll understand;)

Thanks for the quick response btw.
12 years ago
Thanks. Done
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.