CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums




Can Reply:  No Members Can Edit: No Online: Yes
Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.master_pages_themes_and_navigation_controls Tags:
Item Type: NewsGroup Date Entered: 1/2/2008 2:26:29 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
NR
XPoints: N/A Replies: 1 Views: 87 Favorited: 0 Favorite
2 Items, 1 Pages 1 |< << Go >> >|
NDWolfwood5268
Asp.Net User
ASP Menu Static Item Template Throws Databinding Error1/2/2008 2:26:29 PM

0

My work recently upgraded our CMS system to be a master-content page setup, as opposed to our old user control setup. The nav menu is still a user control so it can be dragged/copied/cut into places it need be. Well, the menu, prior to this system upgrade, was upgraded to CSS Friendly Menu Adapters (just for your guys' information) and worked perfectly. Well, after using said menu in said system for a while, a time came where a client wanted some icons in the nav, and I thought 'Static Item Template'. I tried it and got the following error:

 

Server Error in '/st_disc_unlimited' Application.

Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control.

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.InvalidOperationException: Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control.

Source Error:

Line 19:                 <StaticSelectedStyle CssClass="mnuStaticSelected" ItemSpacing="0px" />
Line 20: <StaticItemTemplate>
Line 21: <asp:HyperLink ID="HyperLink1" runat="server" Font-Underline="false" Width="100px" NavigateUrl='<%# Eval("NavigateUrl")%>'><%# Eval("Text") %></asp:HyperLink>
Line 22: </StaticItemTemplate>
Line 23: </asp:Menu>
 

Note I included the static item template in there for all to see the code it doesn't like. This is code that is tried and true; it's been used else where with success and I saved the code. All I need is the top level to have a static item template. Even if someone can find a work-around/solution for the present issue, of which I'm sure there are solutions many, we would like to be able to use this template in the future.

 The template worked fine in a sandbox application in which I tested the menu in a user control format, standard in-the-page format (just placed in the aspx) and the master page setup, with and without the CSS Adapters and was not able to recreate the issue, making me think it's an issue specific to our CMS. I haven't found so much as a mention of this issue in any forums/posts or google search pages. If anyone knows what's going on or has a blind stab, any help is appreciated.

 

Thanks in advance,

~Justin
 

NDWolfwood5268
Asp.Net User
Re: ASP Menu Static Item Template Throws Databinding Error1/2/2008 3:02:51 PM

0

Co-worker solved it, use  <%#Container.DataItem.{attribute}%> in place of my eval statement.

2 Items, 1 Pages 1 |< << Go >> >|


Free Download:


Web:
ASP Menu Static Item Template Throws Databinding Error - ASP.NET ... ASP Menu Static Item Template Throws Databinding Error. Last post 01-02-2008 10: 02 AM by NDWolfwood5268. 1 replies. Sort Posts: ...
Extreme ASP.NET: The Only Data-binding Control You'll Ever Need Like most template controls, the ItemTemplate is going to be the focus of most of .... I have seen many developers resort to trial and error, applying style .... In Figure 8 I have modified the previously static header links for each ...
Free error loging in asp.net Download - error loging in asp.net ... This tutorial explains how to make static or dynamic menus in ASP. .... side script API set * Data binding * Data binding expression and custom item template ... Selected/checked/disabled states of menu item * Keyboard navigation * ASP. ...
CodeProject: DataGrid Template Columns creation in Runtime (using ... Creating Template Columns in runtime and data binding.; ... Static & Panel Controls .... Here, you have added the DDL for the ItemTemplate . ... DataBind() ; cn.Close(); } catch (Exception ex) { lblError.Text="Error Occured"; } } ... i am using Asp GridView. The data in the GridView is filled at runtime from the ...
How to set & show default value in dropdownlist from databound ... Allowing the selection of ddl item also if it is not selected too, a default unit ... from databound items (I am not asking the static -----select---- kind of item) ... But 3rd ddl onwards are not working and giving the error "Object reference .... Sorry my mistake: Round 2:Within the insert template:
Menu ItemTemplate binding problem - ng.asp-net-forum ... ASP Menu Static Item Template Throws Databinding Error - ASP.NET ... Filed under : asp.net 2.0 master page asp:menu menu control css friendly ...






i need help

using tabstrip in asp.net 2.0

error in display

inserting,deleting and modyfing treenode xml of treeview

problem deploying microsoft controls (multipage etc...)

treeview of ms ie web controls

drag and drop in treeview

treeview client-side expanding problem

client-side scripting for netscape

dll is missing when we run build.bat

please help - treeview state

problems with installation / vs.net toolbox

treeview

treeview without codebehind

check child node

parent-child relationship treeview control in asp.net v1.1.4322

treeview control

memory leak

code for ie treeview control with context menu

on firefox we get another treeview instance on click of the menu item

multipage and child controls.

tabstrip view

problem with treeview control...

== why tabstrip doesn't work in ie? ==

populating tree control

client side treeview with xml databinding using xmlhttp

how to build dymanic treenode with code behind?

printing tabs in ie...

can i get any .net developpped library with proper ui

treeview doesn't display correct on some clients

   
  Privacy | Contact Us
All Times Are GMT