I saw the example for binding to a static XML file but that doesn't really help me since I need a menu that reacts to what the user subscribes to (in other words, not everybody sees the same menu). I can create an XML document on the fly from a stored procedure but when I try to bind it I get 'System.Data.Common.DataRecordInternal' displayed on my page instead of a menu. I set RootDatamember in the object properties but I'm sure there is more I need to do but I don't know how. I tried to edit databindings from the context menu but VS2008 froze on me. Also, I'm returning an XML type in a datareader. Can I bind to the datareader or do I need to extract the XML from the datareader first?
Hello,would you be able to provide a sample project that we can evaluate and try to provide the best solution for you. It can be providing just a single statically saved XML bytes, jsut to illustrate your approach. There is no need to provide full feature demo.
There is an option to upload a file here -> "Options" tab when you are replying. you will see the file upload option.
Meanwhile you can try to first extract the full XML before binding.
I don't have a sample project to upload, I only have the existing project that I am trying to add this to and it is huge. Here is what I have in the page itself:
<
ig:WebDataMenu ID="infMainLeftMenu" runat="server" RootDataMember="Header">
</
ig:WebDataMenu>
asp:ScriptManager ID="ScriptManager1" runat="server">
asp:ScriptManager>
This is what I have in code behind:
Dim dr2 As SqlDataReader = objLeftMenu.getMainLeftMenu(m_SessionID, m_ClientID, m_uID, m_fclt)
Dim strXML As Xml = dr2(0)
infMainLeftMenu.DataSource = strXML
'infMainLeftMenu.DataBindings("textValue") = "ItemName"
infMainLeftMenu.DataBind()
dr2 =
Nothing
This what strXML contains:
<Headers><Header HeaderID="SEARCH" HeaderName="Search"><Item><ItemID>ACCSRCH</ItemID><ItemName>Account Search</ItemName><Enabled>1</Enabled></Item><Item><ItemID>PRACSRCH</ItemID><ItemName>Practioner Search</ItemName><Enabled>1</Enabled></Item><Item><ItemID>CONSRCH</ItemID><ItemName>Contact Search</ItemName><Enabled>1</Enabled></Item></Header></Headers>
and this is what I see in the page source after I run the page:
<input type="hidden" id="LeftMenu1_infMainLeftMenu_clientState" name="LeftMenu1_infMainLeftMenu_clientState" /><div id="LeftMenu1_infMainLeftMenu" class="ig_Control igdm_ControlVertical " id="LeftMenu1_infMainLeftMenu" style="display:block;"> <ul class="igdm_MenuGroupVerticalRoot ">
</ul></div>
I see nothing at all in the page now.