Copied to clipboard

Flag this post as spam?

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


  • John Hodgkinson 613 posts 355 karma points
    May 04, 2014 @ 15:56
    John Hodgkinson
    0

    uComponents compatibility with Umbraco 6.2?

    We're also testing within a Web Blocks environment as well... With 6.2 which would be the correct way to access the url picker properties. We're running into issues and are trying to isolate where the problem is:

        var urlPickerLinkTarget = (CurrentBlock.resourceTargetUrl.NewWindow) ? " target=\"_blank\"" : String.Empty;  
    
    <a href="@CurrentBlock.resourceTargetUrl.Url" @Html.Raw(urlPickerLinkTarget)>
        <span class="@CurrentBlock.resourceIconClass icon"></span>
        <span class="resource-title">@CurrentBlock.resourceTitle</span>
    </a>
    

    OR

    var urlPicker = uComponents.DataTypes.UrlPicker.Dto.UrlPickerState.Deserialize(CurrentBlock.resourceTargetURL); var urlPickerLink = urlPicker.Url; var urlPickerLinkTarget = urlPicker.NewWindow ? " target=\"_blank\"" : String.Empty;

    @CurrentBlock.resourceTitle

    I also noticed in a macro partial I used to be able to a typed media item url like:

        var eventImage = !String.IsNullOrEmpty(Convert.ToString(item.eventTeaserImage)) ? 
        String.Format("<img src=\"{0}\" alt=\"{1}\" title=\"{1}\" />", Umbraco.TypedMedia(Convert.ToString(item.eventTeaserImage)).Url, item.pageTitle) : String.Empty; 
    

    but in Umbraco 6.2 now have to access it like:

        var eventImage = item.GetPropertyValue<int>("item.eventTeaserImage") != 0 ? 
        String.Format("<img src=\"{0}\" alt=\"{1}\" title=\"{1}\" />", Umbraco.TypedMedia(Convert.ToString(item.eventTeaserImage)).Url, item.pageTitle) : String.Empty; 
    

    below is here error info we are seeing on two different modules:

    module #1

    Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: The best overloaded method match for 'uComponents.DataTypes.UrlPicker.Dto.UrlPickerState.Deserialize(string)' has some invalid arguments at CallSite.Target(Closure , CallSite , Type , Object ) at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1) at CallSite.Target(Closure , CallSite , Type , Object ) at ASP.PageViewsPartialsFeaturedSliderItemcshtml.Execute() in c:\inetpub\wwwrootcms_wb3\Views\Partials\FeaturedSliderItem.cshtml:line 7 at System.Web.WebPages.WebPageBase.ExecutePageHierarchy() at System.Web.Mvc.WebViewPage.ExecutePageHierarchy() at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) at Umbraco.Core.Profiling.ProfilingView.Render(ViewContext viewContext, TextWriter writer) at System.Web.Mvc.Html.PartialExtensions.Partial(HtmlHelper htmlHelper, String partialViewName, Object model, ViewDataDictionary viewData) at WebBlocks.Views.RenderingEngines.PartialViewRenderingEngine.Render(HtmlHelper html)

    module #2

    Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: The best overloaded method match for 'uComponents.DataTypes.UrlPicker.Dto.UrlPickerState.Deserialize(string)' has some invalid arguments at CallSite.Target(Closure , CallSite , Type , Object ) at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1) at CallSite.Target(Closure , CallSite , Type , Object ) at ASP.PageViewsPartialsFeaturedMemberResourceItemcshtml.Execute() in c:\inetpub\wwwrootcms_wb3\Views\Partials\FeaturedMemberResourceItem.cshtml:line 8 at System.Web.WebPages.WebPageBase.ExecutePageHierarchy() at System.Web.Mvc.WebViewPage.ExecutePageHierarchy() at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) at Umbraco.Core.Profiling.ProfilingView.Render(ViewContext viewContext, TextWriter writer) at System.Web.Mvc.Html.PartialExtensions.Partial(HtmlHelper htmlHelper, String partialViewName, Object model, ViewDataDictionary viewData) at WebBlocks.Views.RenderingEngines.PartialViewRenderingEngine.Render(HtmlHelper html)

Please Sign in or register to post replies

Write your reply to:

Draft