1

I'm using Umbraco 7.04. I would post code but I can't determine what is causing the problem. I did make some edits to a class in my App_Code folder and my website started displaying this error. I reverted those edits but still get the error.

enter image description here

A coworker mentioned that .net can cache files so I tried recycling app pool and editing web.config to no avail.

EDIT: here is the code I believe was causing the problem, although it seemed to have gone away randomly.

BlogHomePage View

@inherits Umbraco.Web.Mvc.UmbracoViewPage<BlogHomePageModel>
@{
    Layout = "BlogLayout.cshtml";
    var BlogBackgroundImageCss = Html.Raw(HttpUtility.HtmlDecode(Model.BannerImageBackgroundImageCss));
    var BlogHomeContent = Html.Raw(HttpUtility.HtmlDecode(Model.BlogHomeContent));        
    var AllTags = Html.Raw(HttpUtility.HtmlDecode(thunder.TagHelper.GetAllTags(Model.Content)));
    var PagingHtml = Html.Raw(HttpUtility.HtmlDecode(Model.PagingHtml));
}

<div class="blog-area">
    <div class="blog-banner-area" style="@BlogBackgroundImageCss" >
        <span>@Model.BannerImageTitle</span>
    </div>
    <div class="blog-nav-area">
        <button class="blog-nav-collapse-button"><span>Search</span></button>
        <div class="blog-nav-inner-area">
            @{ Html.RenderPartial("BlogHomeSearchInformation", Model); }
            @{ Html.RenderPartial("BlogPostSearch"); }
            @AllTags
            @{ Html.RenderPartial("BlogHomeAside", Model); /*use partial to render blog post aside*/ }        
        </div>
    </div>
    <div class="blog-main-area">
        <div class="blog-heading-area">
            <div class="blog-heading-text-container">
                @BlogHomeContent
                <button class="blog-about-this-blog-expand-button">Read More</button>
            </div>
        </div>
        @if (Model.Posts.Count() > 0) {
            foreach (var Post in Model.Posts) {
                Html.RenderPartial("BlogHomePostPartial", Post); /*use partial to render blog post content*/
            }
            @PagingHtml
        } else {
            <p>Sorry, but no posts matched your query.</p>
        }        
    </div>
</div>

BlogHomeSearchInformationPartial

@inherits Umbraco.Web.Mvc.UmbracoViewPage<BlogHomePageModel>
@{
    string SearchTerm = (!string.IsNullOrEmpty(Request.QueryString["s"])) ? Request.QueryString["s"] : "";
    string TagTerm = (!string.IsNullOrEmpty(Request.QueryString["t"])) ? Request.QueryString["t"] : "";
}

<div id="blog-search-results-information">
    @if (!string.IsNullOrEmpty(SearchTerm)) {
        if (Model.TotalResults == 1) {
            <p>Your search for "@SearchTerm" returned @Model.TotalResults result. <a href="/">Click here</a> to return to home page.</p>
        } else {
            <p>Your search for "@SearchTerm" returned @Model.TotalResults results. <a href="/">Click here</a> to return to home page.</p>
        }
    }
    @if (!string.IsNullOrEmpty(TagTerm)) {
        if (Model.TotalResults == 1) {
            <p>There is @Model.TotalResults post tagged "@TagTerm". <a href="/">Click here</a> to return to home page.</p>
        } else {
            <p>There are @Model.TotalResults posts tagged "@TagTerm". <a href="/">Click here</a> to return to home page.</p>
        }
    }
</div>

BlogPostSearch

@inherits UmbracoTemplatePage
@{
    string SearchTerm = "";
    SearchTerm = Request.QueryString["s"];
}
<form role="search" method="get" id="searchform" action="/">
    <div class="blog-search-area">
        <input type="search" name="s" value="@SearchTerm">
        <button type="submit">Search</button>
    </div>
</form>

BlogPostAside

@inherits Umbraco.Web.Mvc.UmbracoViewPage<BlogHomePageModel>
@{
    var AsideLinks = Html.Raw(HttpUtility.HtmlDecode(Model.AsideLinks));
}
@if (!string.IsNullOrEmpty(Model.AsideHeading) || !string.IsNullOrEmpty(Model.AsideSubheading) || !string.IsNullOrEmpty(Model.AsideContent) || !string.IsNullOrEmpty(Model.AsideLinks)) {
    <div class="blog-contact-area">
        <span class="blog-contact-heading">@Model.AsideHeading</span>
        <span class="blog-contact-subheading">@Model.AsideSubheading</span>
        <p>@Model.AsideContent</p>
        @AsideLinks
    </div>
}
tereško
  • 58,060
  • 25
  • 98
  • 150
Nathan
  • 111
  • 2
  • 14

2 Answers2

0

Seems to me you have defined a special model on your view (or you did inherit form something). Try to remove the @model and the @inherits from your view.

dampee
  • 3,392
  • 1
  • 21
  • 37
  • 1
    thanks for the suggestion, but i was using a specific model because wanted to. just strange that the error message was so misleading. – Nathan Jul 07 '14 at 13:25
0

problem solved itself mysteriously :( After a little more research I believe it may be related to this question: The model item passed into the dictionary is of type ‘mvc.Models.ModelA’ but this dictionary requires a model item of type ‘mvc.Models.ModelB‘

Community
  • 1
  • 1
Nathan
  • 111
  • 2
  • 14