This is a migrated thread and some comments may be shown as answers.

[Solved] The type or namespace name 'SourceCodeFile' could not be found (are you missing a using directive or an assembly reference?)

2 Answers 476 Views
Menu
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Dennis Gundersen
Top achievements
Rank 1
Dennis Gundersen asked on 02 Oct 2010, 10:52 AM
Hi

I'm trying out the MVC extensions, but I can't make the menu work using the example as I get an error on the "SourceCodeFile" line. What do I need to import to make this work? (I'm using VS2010 and .net 4)

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Telerik.Web.Mvc;
using Telerik.Web.Mvc.UI;
  
namespace Menu.Controllers
{
    public class MenuController : Controller
    {
        [PopulateSiteMap(SiteMapName = "sample", ViewDataKey = "sample")]
        [SourceCodeFile("Sitemap", "~/sample.sitemap")]
        public ActionResult SiteMapBinding() 
        
            if (!SiteMapManager.SiteMaps.ContainsKey("sample")) 
            
                SiteMapManager.SiteMaps.Register<XmlSiteMap>("sample", sitmap => sitmap.LoadFrom("~/sample.sitemap")); 
            
            return View(); 
        }
    }
}

Re
Dennis

2 Answers, 1 is accepted

Sort by
0
Andrew
Top achievements
Rank 1
answered on 10 Feb 2011, 08:29 PM
Same problem here.  Please help and thanks in advance!

Update: A bit more Googling yielded the answer here: http://www.telerik.com/community/forums/aspnet-mvc/grid/sourcecodefile-attribute-in-vb-net.aspx.  To summarize, it's not needed.
0
Sysdata Labs
Top achievements
Rank 1
answered on 16 Apr 2011, 07:43 AM
@Andrew, thanks for the link!
Tags
Menu
Asked by
Dennis Gundersen
Top achievements
Rank 1
Answers by
Andrew
Top achievements
Rank 1
Sysdata Labs
Top achievements
Rank 1
Share this question
or