Copied to clipboard

Flag this post as spam?

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


  • Matt Bliss 176 posts 234 karma points c-trib
    Nov 29, 2012 @ 23:11
    Matt Bliss
    0

    Examine dll Problem

    I've created a user control for an Umbraco 4.9.1 site based on the Umbraco TV Examin example at http://umbraco.com/help-and-support/video-tutorials/developing-with-umbraco/examine.aspx

    The project compiles without any problems but when I add the user control to an Umbraco Macro and try to view the page the following error is shown on the page:

    Error creating control (usercontrols/SearchResultList.ascx).
    Maybe file doesn't exists or the usercontrol has a cache directive, which is not allowed! See the tracestack for more information!

    and then this in the stack trace:

    Error creating usercontrol (usercontrols/SearchResultList.ascx)
    c:\...\usercontrols\SearchResultList.ascx(9): error CS0234: The type or namespace name 'SeachResults' does not exist in the namespace 'Examine' (are you missing an assembly reference?)
      at System.Web.Compilation.AssemblyBuilder.Compile()
      at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath)
      at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
      at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
      at System.Web.Compilation.BuildManager.GetVPathBuildResult(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean ensureIsUpToDate)
      at System.Web.UI.TemplateControl.LoadControl(VirtualPath virtualPath)
      at umbraco.macro.loadUserControl(String fileName, MacroModel model, Hashtable pageElements)

    What am I missing?

     

     

  • Ismail Mayat 4511 posts 10091 karma points MVP 2x admin c-trib
    Nov 30, 2012 @ 13:22
    Ismail Mayat
    0

    Can you paste codebehid of .ascx pls

  • Matt Bliss 176 posts 234 karma points c-trib
    Nov 30, 2012 @ 13:38
    Matt Bliss
    0

    Sure, here it is

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using Examine;
     
    namespace MyNameSpace
    {
        public partial class SearchResultList : System.Web.UI.UserControl
        {
            protected string SearchTerm { get; private set; }
            protected IEnumerable<SearchResult> SearchResults { get; private set; }
            private string[] propertyAliases;
     
            public SearchResultList()
            {
                SearchTerm = string.Empty;
                SearchResults = new List<SearchResult>();
                propertyAliases = new string[]
                {
                    "pageTitle",
                    "pageDisplayTitle",
                    "pageSummary",
                    "mainContent",
                    "column1",
                    "column2",
                    "column3",
                    "column4",
                    "listTitle",
                    "listEntries"
                };
            }
     
            protected void Page_Load(object sender, EventArgs e)
            {
     
                SearchTerm = Request.QueryString["s"];
                if (string.IsNullOrEmpty(SearchTerm)) return;
     
                var criteria = ExamineManager.Instance
                    .SearchProviderCollection["FrontEndSearcher"]
                    .CreateSearchCriteria();
     
                var filter = criteria
                    .GroupedOr(propertyAliases, SearchTerm)
                    .Not()
                    .Field("umbracoNavHide", "1")
                    .Compile();
     
                SearchResults = ExamineManager.Instance.SearchProviderCollection["FrontEndSearcher"].Search(filter);
     
                SearchResultRepeater.DataSource = SearchResults;
                SearchResultRepeater.DataBind();
            }
        }
    }
  • Matt Bliss 176 posts 234 karma points c-trib
    Dec 03, 2012 @ 12:42
    Matt Bliss
    0

    Sorry silly mistake a typo in the .ascx file!

Please Sign in or register to post replies

Write your reply to:

Draft