Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Rawdon 6 posts 65 karma points
    Jan 30, 2015 @ 12:59
    Rawdon
    0

    cast issue when viewing blog

    hello again, i found i can view individual blogs from the Archive properties links but when ever i try and view the main blog (top level i.e the Articulate) i get this:

     

    Cannot cast source content type Articulate.Models.ListModel to view model type Articulate.Models.PostModel.

     

     

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.InvalidCastException: Cannot cast source content type Articulate.Models.ListModel to view model type Articulate.Models.PostModel.

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


    Stack Trace:

    [InvalidCastException: Cannot cast source content type Articulate.Models.ListModel to view model type Articulate.Models.PostModel.]
       Umbraco.Web.Mvc.UmbracoViewPage`1.SetViewData(ViewDataDictionary viewData) +1119
       System.Web.Mvc.WebViewPage.ConfigurePage(WebPageBase parentPage) +133
       System.Web.WebPages.<>c__DisplayClass7.<RenderPageCore>b__6(TextWriter writer) +324
       System.Web.WebPages.WebPageBase.RenderSurrounding(String partialViewName, Action`1 body) +208
       System.Web.WebPages.WebPageBase.PopContext() +195
       Umbraco.Core.Profiling.ProfilingView.Render(ViewContext viewContext, TextWriter writer) +140
       System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +380
       System.Web.Mvc.<>c__DisplayClass1a.<InvokeActionResultWithFilters>b__17() +33
       System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +613
       System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +613
       System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +263
       System.Web.Mvc.Async.<>c__DisplayClass25.<BeginInvokeAction>b__22(IAsyncResult asyncResult) +230
       System.Web.Mvc.<>c__DisplayClass1d.<BeginExecuteCore>b__18(IAsyncResult asyncResult) +28
       System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +15
       System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +53
       System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +15
       System.Web.Mvc.<>c__DisplayClass8.<BeginProcessRequest>b__3(IAsyncResult asyncResult) +42
       System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +15
       System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +606
       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +288
    

     

    any surgestions what i did wrong ?

  • Rawdon 6 posts 65 karma points
    Jan 30, 2015 @ 19:04
    Rawdon
    100

    nm it was coz the kist has

    Layout = "Master.cshtml";

    and i had changed the master to

    @inherits Umbraco.Web.Mvc.UmbracoViewPage<Articulate.Models.PostModel>

    setting it back to

    @inherits Umbraco.Web.Mvc.UmbracoViewPage<Articulate.Models.IMasterModel>

    fixed the issue, now seeing

    A potentially dangerous Request.Path value was detected from the client (:).

    on some of the links...but i can fix this with http://stackoverflow.com/questions/81991 

  • Rawdon 6 posts 65 karma points
    Jan 31, 2015 @ 16:21
    Rawdon
    0

    just an fyi the config didnt work i had to change the TagCloud.cshtml from

    <div class="contained tag-cloud">
        <h3 class="typo-heading-sub">Popular Tags</h3>
        @Html.TagCloud(tagModel, 5, 50)
    </div>

    to

    @foreach (var tag in tagModel)
        {
            <a href="@string.Format("{0}/tags/{1}", Model.RootBlogNode.Url, tag.TagName)">@tag.TagName</a>
        }

  • Bobi 352 posts 956 karma points
    Feb 21, 2017 @ 23:43
    Bobi
    0

    This was extremely helpful. Thank you very much :)

    Now to figure out how to prevent each blog image from cropping...

Please Sign in or register to post replies

Write your reply to:

Draft