Rank: Newbie Groups: Member
Joined: 6/30/2009 Posts: 7
|
Can't get my page to work if I have the Menu control on it. Page works great when I take the menu control out. Are there any known issues with the Menu and LinqDataSources? Stack Trace here, and Menu markup at bottom:
[Exception of type 'System.Web.HttpUnhandledException' was thrown.] Child Exceptions: [Object reference not set to an instance of an object.]
at System.Web.UI.WebControls.LinqDataSourceView.CreateContextAndTable(DataSourceOperation operation) at System.Web.UI.WebControls.LinqDataSourceView.CreateContextAndTableForSelect() at System.Web.UI.WebControls.LinqDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) at System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) at System.Web.UI.WebControls.DataBoundControl.PerformSelect() at System.Web.UI.WebControls.BaseDataBoundControl.DataBind() at System.Web.UI.WebControls.GridView.DataBind() at System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() at System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() at System.Web.UI.Control.EnsureChildControls() at System.Web.UI.WebControls.CompositeDataBoundControl.get_Controls() at EO.Web.Internal.a3.a(Control A_0, Hashtable A_1, Type A_2, Boolean A_3) at EO.Web.Internal.a3.a(Control A_0, Hashtable A_1, Type A_2, Boolean A_3) at EO.Web.Internal.a3.a(Control A_0, Hashtable A_1, Type A_2, Boolean A_3) at EO.Web.Internal.a3.a(Control A_0, Hashtable A_1, Type A_2, Boolean A_3) at EO.Web.Internal.a3.a(Control A_0, Hashtable A_1, Type A_2, Boolean A_3) at EO.Web.Internal.a3.a(Control A_0, Hashtable A_1, Type A_2, Boolean A_3) at EO.Web.Internal.a3.a(Control A_0, Hashtable A_1, Type A_2, Boolean A_3) at EO.Web.Internal.a3.a(Control A_0, Hashtable A_1, Type A_2, Boolean A_3) at EO.Web.Internal.a3.a(Control A_0, Type A_1, Boolean A_2) at EO.Web.Internal.a3.a(Control A_0, Type A_1) at EO.Web.CustomItem.a(Control A_0) at EO.Web.Internal.g4.a(Control A_0, HtmlTextWriter A_1) at EO.Web.Internal.g4.b(Control A_0, HtmlTextWriter A_1) at EO.Web.Internal.g4.c(Control A_0, HtmlTextWriter A_1) at EO.Web.Internal.l.a(HtmlTextWriter A_0) at EO.Web.BaseNavigator.b(HtmlTextWriter A_0) at EO.Web.WebControlBase.n(HtmlTextWriter A_0) at EO.Web.WebControlBase.a(HtmlTextWriter A_0) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) at System.Web.UI.Control.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) at System.Web.UI.WebControls.LoginView.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) at System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) at System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) at System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) at System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) at System.Web.UI.Control.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) at System.Web.UI.Page.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Menu markup:
<eo:Menu ID="menuMain" runat="server" Width="360px" ControlSkinID="MSDN" HideRoleDisabledItems="true"> <TopGroup> <Items> <eo:MenuItem NavigateUrl="~/default.aspx" Text-Html="Home" > </eo:MenuItem> <eo:MenuItem Status="View and manage account settings" Text-Html="My Account"> <SubMenu> <Items> <eo:MenuItem NavigateUrl="~/MemberPages/Enroll.aspx" Status="Edit your user profile and billing information" Text-Html="User Profile"> </eo:MenuItem> <eo:MenuItem NavigateUrl="~/MemberPages/ChangePassword.aspx" Status="Change the password and/or username for your account" Text-Html="Username and Password"> </eo:MenuItem> <eo:MenuItem NavigateUrl="~/MemberPages/Account.aspx" Status="Review charges and payments" Text-Html="Payment History"> </eo:MenuItem> <eo:MenuItem NavigateUrl="~/MemberPages/PrincipalPreferences.aspx" Status="Manage preferences for your program users" Text-Html="Principal Preferences" AllowRoles="Principal"> </eo:MenuItem> </Items> </SubMenu> </eo:MenuItem> <eo:MenuItem Status="View and manage your prospects" Text-Html="My People"> <SubMenu> <Items> <eo:MenuItem NavigateUrl="~/MemberPages/po.aspx" Status="Create a contact and send a ticket in one step" Text-Html="Post Office"> </eo:MenuItem> <eo:MenuItem NavigateUrl="~/MemberPages/ContactManager.aspx" Status="Manage contacts and send tickets" Text-Html="Contact Manager"> </eo:MenuItem> <eo:MenuItem NavigateUrl="~/MemberPages/CustomerManager.aspx" Status="Lookup information for users in your program" Text-Html="Customer Viewer" AllowRoles="Principal"> </eo:MenuItem> </Items> </SubMenu> </eo:MenuItem> <eo:MenuItem Status="Manage your theaters" Text-Html="My Theaters"> <SubMenu> <Items> <eo:MenuItem Status="Access and manage buttons, backgrounds and videos" Text-Html="Libraries"> <SubMenu> <Items> <eo:MenuItem NavigateUrl="~/MemberPages/BackgroundLibrary.aspx" Status="Upload and manage backgrounds" Text-Html="Backgrounds"> </eo:MenuItem> <eo:MenuItem NavigateUrl="~/MemberPages/ButtonLibrary.aspx" Status="Upload and manage buttons" Text-Html="Buttons"> </eo:MenuItem> <eo:MenuItem NavigateUrl="~/MemberPages/VideoLibrary.aspx" Status="Upload and manage videos" Text-Html="Videos"> </eo:MenuItem> </Items> </SubMenu> </eo:MenuItem> <eo:MenuItem NavigateUrl="~/MemberPages/TheaterFactory.aspx" Status="Build and manage your theaters" Text-Html="Factory"> </eo:MenuItem> <eo:MenuItem NavigateUrl="~/MemberPages/ResultsLab.aspx" Status="View realtime reports" Text-Html="Results Lab"> </eo:MenuItem> </Items> </SubMenu> </eo:MenuItem> <eo:MenuItem Text-Html="Administration" AllowRoles="Administrator" > <SubMenu> <Items> <eo:MenuItem NavigateUrl="~/Admin/SendUpdate.aspx" Status="Send updates to all users" Text-Html="Send System Updates"> </eo:MenuItem> <eo:MenuItem NavigateUrl="~/Admin/Pocus.aspx" Status="Review exception info" Text-Html="Pocus"> </eo:MenuItem> <eo:MenuItem NavigateUrl="~/Admin/PostPayment.aspx" Status="Post Transactions" Text-Html="Transactions"> </eo:MenuItem> <eo:MenuItem NavigateUrl="~/Admin/LookupUser.aspx" Status="Lookup User Information" Text-Html="User Lookup"> </eo:MenuItem> </Items> </SubMenu> </eo:MenuItem> <eo:MenuItem Status="Get Help" Text-Html="Help"> <SubMenu> <Items> <eo:MenuItem NavigateUrl="~/MemberPages/NewSignup.aspx" Status="Get pointers for starting to use the system" Text-Html="Getting Started"> </eo:MenuItem> <eo:MenuItem Status="Send an email" Text-Html="Contact Us"> </eo:MenuItem> <eo:MenuItem NavigateUrl="http://www.google.com" Status="Open a support ticket" Text-Html="Tech Support"> </eo:MenuItem> </Items> </SubMenu> </eo:MenuItem> </Items> </TopGroup> </eo:Menu>
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
The menu does not have any issue with LinqDataSources. The error most likely is related to your LinqDataSource (it occurs when you try to bind to your LinqDataSource). The stack trace shows that you have used a CustomItem. Try to take the LinqDataSource and the control that uses the DataSource outside of the CustomItem control and you should see the same problem.
Since a CustomItem is always used together with a Navigator (Menu, TreeView, etc). It is not rendered if the navigator object is not rendered. The menu only triggered this error because if the menu is not rendered (or does not exist), the CustomItem is not rendered, and as a result, your data binding code would not be called.
Thanks!
|
Rank: Newbie Groups: Member
Joined: 6/30/2009 Posts: 7
|
I do see CustomItem in the stacktrace, but it is not in the menu markup. In addition, the instances of LinqDataSource are all outside of the menu. The EO.Menu is part of my masterpage. The LinqDataSources in my app are always part of the content pages. As I mentioned, if the menu is removed from this page, it works fine (as it has been working; this is not a new app - we're looking at purchasing your tools to add a number of enhancements to the site). Again, this is the only page in the site that fails now that the EO.Menu is on the page.
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
tbrentlong wrote:I do see CustomItem in the stacktrace, but it is not in the menu markup. That does not matter. All CustomItems are rendered by the first Navigator on the page. It does not matter whether that Navigator uses any of the CustomItems, or whether the Navigator is in your content page or master page. As soon as you have CustomItems in your page, they will be rendered by the first Navigator in your page. tbrentlong wrote:In addition, the instances of LinqDataSource are all outside of the menu. It's the control that uses the LinqDataSource (whose DataSourceID is set to LinqDataSource) that triggers the error, moving the LinqDataSource around does not change the trigger condition. We suggested you to take both out because that way ensures both (LinqDataSource and control that uses LinqDatasource) will be in the same NamingContainer, but what really matters is the control that uses the LinqDataSource. So try them out of the CustomItem. tbrentlong wrote:The EO.Menu is part of my masterpage. The LinqDataSources in my app are always part of the content pages. As I mentioned, if the menu is removed from this page, it works fine (as it has been working; this is not a new app - we're looking at purchasing your tools to add a number of enhancements to the site). Again, this is the only page in the site that fails now that the EO.Menu is on the page. I would suggest you take everything out of the CustomItem as a test. I understand that you have taken out the Menu and the page runs fine at this point. However I would expect the error to reappear after you take out of the CustomItem. Please feel free to let us know if you still have problems. We can take a look on your machine through gotomeeting if you still believe it has to do with the menu. Please let us know if you would like us to do that. Thanks!
|
Rank: Newbie Groups: Member
Joined: 6/30/2009 Posts: 7
|
I've searched my entire project for CustomItem, but don't have it anywhere. Maybe I'm not understanding what you're saying. If you would look at this via gtm, that would be great. Let me know how to contact you for that.
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
Please see your private message for details.
Thanks!
|
Rank: Newbie Groups: Member
Joined: 6/30/2009 Posts: 7
|
Awesome support! Thanks Jack.
The issue turned out to be an invalid table name in a LinqDataSource control that was in a part of the page that was not being rendered (in a panel whose visibility was set to false). It would seem that since the control was not rendering that it would not cause a problem. However, when the TableName property was set correctly, the issue was resolved.
EO Tech support gave a bit of insight as to why. The Menu control as part of it's rendering process will scan the Controls collection of every item on the page, whether it is visible or not. When the controls property of a gridview that was bound to a LinqDataSource (LDS) with a faulty TableName was iterated, it caused the LDS to generate a nullref when it attempted to reach the nonexistent table.
So, bottom line is the LDS control would have probably have eventually raised an exception with the menu removed from the page, had it reached a point when it was made visible. If not, then the data would certainly have not been there as expected. Recommended debug: remove the menu from the page and make double sure that everything works prior to adding it back.
If it doesn't work then, get EO involved -- can't say enough good about the tech support! Thanks again!
bl
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Thank you very much for your kind words. Please do not forget to recommend us to others when you have a chance!
|