asp.net mvc 3 - Compile-time error: rendering a partial view within a partial view -


i trying render partial page inside partial page. have in layout page call partial createmenu , here pass model layout page. works perfect. inside createmenu partial trying call menuitem same syntax fails. visual studio shows path red (i know 100% exists).

how can render partial inside partial.

menupartial's call render:

@html.partial("~/models/default/usercontrols/_menuitem.cshtml", model.modules[i])     

model.modules[i] consists of mvcmodule objects.

menuitem:

@model models.default.classes.mvcmodule <li class="@{if (model.canexpand) {<text>fullwidth</text>} else {<text>nodrop</text>}} first_fullwidth"> ... 

this results in compilation error:

compiler error message: cs0115: "asp._page_models_default_usercontrols__menuitem_cshtml.execute()": es wurde keine passende methode zum Überschreiben gefunden. line 46: public override void execute() {

sorry german text. have tried output english instead vs 2010 refuses change settings =/

i don't think nested partial issue. should able nest partials without problem. looks partial you're trying render in ~/models/default/usercontrols directory. isn't place default view engine looks views. try copying web.config file views directory models directory.

if me, try avoid storing views outside of views directory if @ possible avoid weird issues this.


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -