I am new to ASP.Net with ContentPlaceholders.
My problemn is:
I have a masterpage on which are 3 ContentPlaceHolders.
ContentPlaceholderLeft, ContentplaceholderContent, ContentplaceholderRight.
In the Left I have a treeview in the Contentpart I have a Detailsview.
When I click at the left the content has to be changed with the ControlParameter, this lead to an Error can't find ControlParameter p1 from treeview.
When I do the same thing in the page without contentholders it works perfect.
Other problemn is, the treeview I am using has to start at different points.
In the topmenu it can select the Headcategory which changes the start values of the tree. Sometimes I use an other table for the tree to show it.
Under is my code. At the menu_ParentId that will be different for each Headcategory and must change everytime I click in the topmenu.
Hope there is someone who figered this out earlier.
Many thanks,
Johan Veldkamp
<asp:Content ID="Content1" ContentPlaceHolderID="LeftContentPlaceHolder" Runat="Server">
Voor Wie
<asp:TreeView ID="VoorWieTree" ExpandDepth="1" PopulateNodesFromClient="true" ShowLines="False" ShowExpandCollapse="True" runat="server" />
</asp:Content>
Dim connectionString As String
connectionString = ConfigurationManager.ConnectionStrings("BouwgegevensConnectionString").ConnectionString
Dim objConn As New SqlConnection(connectionString)
Dim objCommand As New SqlCommand("select Menu_Id,Menu_Titel,(select count(*) FROM tbMenu " _
& "WHERE Menu_ParentID=sc.Menu_Id) childnodecount FROM tbMenu sc where Menu_ParentID = 1", objConn)
Dim da As New SqlDataAdapter(objCommand)
Dim dt As New DataTable()
da.Fill(dt)
PopulateNodes(dt, VoorWieTree.Nodes)
End Sub
Last edited by JohanVeldkamp; 04-12-2011 at 09:57 AM.
Reason: some thing to it
its hard to see what your trying to do when only part of the code and not the part you are asking about.
From what I'm reading you have a treeview and a dataview and you want to click on the treeview and update the dataview, can you show us the code you have so far?
The code you have give is just adding a few controls and databinding to the treeview. Where is the code you have tried? Can you show the code you have working and the code that doesn't work?
More searching on the web, I found the sollution for my problemn:
The text in red solved it. With the controlparameter in de contentplaceholder I want to get the "Querystring" the treeview. With using the wright ID, i got it working.
Thanks for your help allready.
Greetings,
Johan
<asp:Content ID="Content1" ContentPlaceHolderID="LeftContentPlaceHolder" Runat="Server">
Voor Wie
<asp:TreeView ID="VoorWieTree" ExpandDepth="1" PopulateNodesFromClient="true" ShowLines="False" ShowExpandCollapse="True" runat="server" />
</asp:Content>
Bookmarks