Hej!
Jag håller på med en sitemap i EpiServer och stöter på patrull. Jag har snott den sitemap som finns i exempelinstallationen och försöker modifiera denna för mitt behov men jag stöter på problem med denna, det blir något fel vid Databind. Är det någon som använt sitemap och vet vad det kan vara som är bekymret så är jag tacksam för tips. Nedan är felutskriften:
Server Error in '/' Application.
--------------------------------------------------------------------------------
A error occurred while databinding "DefaultFramework:MainRegionContent:SiteMap:SitemapControl", some values set on the page where null references [Object reference not set to an instance of an object.]
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.NullReferenceException: A error occurred while databinding "DefaultFramework:MainRegionContent:SiteMap:SitemapControl", some values set on the page where null references [Object reference not set to an instance of an object.]
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:
[NullReferenceException: A error occurred while databinding "DefaultFramework:MainRegionContent:SiteMap:SitemapControl", some values set on the page where null references [Object reference not set to an instance of an object.]]
EPiServer.WebControls.PageControlBase.DataBind() +130
System.Web.UI.Control.DataBind() +86
System.Web.UI.Control.DataBind() +86
System.Web.UI.Control.DataBind() +86
System.Web.UI.Control.DataBind() +86
System.Web.UI.Control.DataBind() +86
Taxi.Intranet.Frameworks.DefaultFramework.Page_Load(Object sender, EventArgs e) +23
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Control.LoadRecursive() +98
System.Web.UI.Page.ProcessRequestMain() +750
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2300; ASP.NET Version:1.1.4322.2300
//Mats
Hi!
I will answer this in english. Mats is asking about null reference errors on databind when he is using the SiteMap control.
The problem probably lies within a databound scriptblock that you are using in your user control. Silly example: you try to fetch the value of object's attrubute, but the object has not been instanciated:
'>
and in codebehind:
protected PageData MyPage; //not instanciated
Go through your scriptblocks and see if you find anything like this.
I would recomend to strip the sitemap control until it works. Then you should know whats causing the problem. I wouldn't stare blindly at the declaration of databound sitemap properties either. The problem might as well be any databound data inside of the sitemap's template declarations.